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 replaced

Connection 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 --yes

Flags

FlagDefaultDescription
--backupBackup job to restore (id)
-d, --datasourceData source the backup belongs to (id)
--modeWhere the data goes: new_database, new_server, overwrite
--target-databaseName of the database to create (new_database only)
--target-uri-fileRead the target connection string from this file (- for standard input)
--waitWait until the restore finishes (Ctrl-C stops waiting, not the restore)
--wait-timeout6h0m0sGive up waiting after this long (the job keeps running on the server)
--yesSkip 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

On this page