CLI reference
norcube backup restores create
Restore a backup into a database
Not verified yet
Starts a restore of one successful backup (norcube backup jobs list
shows them). --mode picks where the data goes:
new_database create --target-database on the server in --target-uri-file
(the connection string needs the right to create databases)
new_server restore into the database named in --target-uri-file
overwrite restore over the data source's own database with its stored
credentials (they need write access); its data is replacedConnection strings are read from a file (--target-uri-file, - for standard input), never from the command line, so they stay out of shell history. They are stored encrypted and never shown again.
A restore changes data, so the command asks first; --yes answers for scripts, and without a terminal --yes is required. With --wait it waits for the restore to finish and exits 1 (code job_failed) when it failed.
Usage
norcube backup restores create [flags]Examples
# Into a fresh database next to production
norcube backup restores create -d 9f8e7d6c-… --backup 6a1b2c3d-… \
--mode new_database --target-uri-file admin.uri --target-database app_restored --wait
# Roll the data source back to a backup (replaces its data)
norcube backup restores create -d 9f8e7d6c-… --backup 6a1b2c3d-… --mode overwrite --yesFlags
| Flag | Default | Description |
|---|---|---|
--backup | Backup job to restore (id) | |
-d, --datasource | Data source the backup belongs to (id) | |
--mode | Where the data goes: new_database, new_server, overwrite | |
--target-database | Name of the database to create (new_database only) | |
--target-uri-file | Read the target connection string from this file (- for standard input) | |
--wait | Wait until the restore finishes (Ctrl-C stops waiting, not the restore) | |
--wait-timeout | 6h0m0s | Give up waiting after this long (the job keeps running on the server) |
--yes | Skip the confirmation prompt (required when stdin isn't a terminal) |
Every command also takes the global flags: --profile, --org, -o, --query, --debug and more.
See also
norcube backup restores: Restore backups into a database and follow the restores