Importing Configurations
#The commands plakar store, plakar source and plakar destination configure storage locations, backup sources, and restore destinations respectively.
Each command includes an import subcommand for importing configurations from different sources.
Basic Usage
#The import subcommand can read configuration data from:
- Standard input (stdin) — useful for piping from other commands
- A file specified with the
-configoption - URLs (when using
-configwith a URL)
Importing from a Configuration File
#Use the -config option to specify a configuration file to import. Create a YAML file with the appropriate structure for the type of configuration you’re importing.
For example, to import store configurations, create a file like my-stores.yaml:
minio:
access_key: minioadmin
location: s3://localhost:9000/kloset
passphrase: superpassphrase
secret_access_key: minioadmin
use_tls: "false"Then import it with:
$ plakar store import -config my-stores.yamlSimilarly for sources and destinations:
$ plakar source import -config my-sources.yaml
$ plakar destination import -config my-destinations.yamlThe configuration files should be in YAML format with named sections for each configuration entry.
Importing from Piped Input
#You can pipe configuration data directly from other commands:
# Import a specific source configuration as a destination
$ plakar source show -secrets | plakar destination import mybucket
# Import all sources as destinations
$ plakar source show -secrets | plakar destination import
# Import from rclone configuration
$ rclone config show -secrets | plakar store import -rclone koofrSection Selection
#You can specify which sections to import by listing their names. Sections can be renamed during import by appending :newname.
# Import only specific sections
$ plakar store import -config stores.yaml section1 section2
# Import and rename sections
$ plakar store import -config stores.yaml oldname:newnameConfiguration File Format
#Configuration files should be in YAML format. Each top-level key represents a named configuration section.
Store Configuration Example
#mystorage:
location: s3://mybucket
access_key: myaccesskey
secret_access_key: mysecretkey
localbackup:
location: /var/backupsSource Configuration Example
#myapp:
location: /var/www/myapp
excludes: "*.log,*.tmp"
database:
location: postgresql://user:pass@localhost/mydbDestination Configuration Example
#restorepoint:
location: /mnt/restore
permissions: 0755
cloudrestore:
location: s3://restore-bucket
access_key: restorekey
secret_access_key: restoresecretPractical Examples
#Migrating from rclone
#If you have rclone configurations, you can easily import them as Plakar stores:
# Show available rclone remotes
$ rclone config show
# Import a specific rclone remote as a Plakar store
$ rclone config show | plakar store import -rclone myremoteBulk Configuration Management
#You can export and import configurations between different Plakar installations:
# Export current store configurations
$ plakar store show -secrets > stores-backup.yaml
# Import on another machine
$ plakar store import -config stores-backup.yamlConverting Sources to Destinations
#A common use case is to use the same locations for both backup sources and restore destinations:
# Import all sources as destinations
$ plakar source show -secrets | plakar destination import
# Import a specific source as a destination with a new name
$ plakar source show -secrets | plakar destination import mysource:myrestoreVerification
#After importing, verify the configuration was imported correctly:
$ plakar store show
$ plakar source show
$ plakar destination showUse the check subcommand to validate configurations:
$ plakar store check mystore
$ plakar source check mysource
$ plakar destination check mydestTroubleshooting
#Common Issues
#-
Permission Denied: Ensure you have read access to the configuration file and write access to Plakar’s configuration directory.
-
Invalid YAML: Validate your YAML syntax before importing. Use tools like
yamllintor online validators. -
Name Conflicts: Use
-overwriteto replace existing configurations, or rename sections during import. -
rclone Import Issues: Ensure rclone is installed and the specified remote exists in your rclone configuration.