/restore/backup

URL: http://<db.host>:<db.port>/restore/backup

Restores objects from a backup instance. Response from a backup restoration operation.

Input Parameter Description

NameTypeDescription
backup_namestringName of the backup object, which must refer to a currently existing backup. The default value is ''.
restore_objects_mapmap of string to strings

Map of objects to be restored from the backup. Error if empty.

Supported Parameters (keys)Parameter Description
allAll object types (except for non-schema based objects such as permissions, procs, etc.)
tableDatabase Table
credentialCredential
contextContext
datasinkData Sink
datasourceData Source
sql_procSQL Procedure
streamStream
security_entityUser or role and associated permissions
directory[Not currently supported] KiFS File Directory
proc[Not currently supported] UDF Procedure
secret_key

If true, restore the database key for encrypting secrets The default value is false. The supported values are:

  • false
  • true
configuration

If true, restore the database configuration file The default value is false. The supported values are:

  • false
  • true
datasource_namestringDatasource where backup is located.
optionsmap of string to strings

Optional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys)Parameter Description
backup_idBackup instance ID to restore. Leave empty to restore the most recent backup instance. The default value is ''.
restore_policy

Behavior to apply when restoring objects that already exist The default value is none.

Supported ValuesDescription
noneIf an object to be restored currently exists with the same name, abort and return error
replaceIf an object to be restored currently exists with the same name, replace it with the backup version
renameIf an object to be restored currently exists with the same name, rename the original version
renamed_objects_schemaIf the restore policy is rename, optionally use this schema for renamed objects instead of a default generated one. The default value is ''.
create_schema_if_not_exist

Create the schema for an object to be restored if it does not currently exist. Error otherwise. The default value is true. The supported values are:

  • false
  • true
ddl_only

Only recreates the objects from their DDL, do not restore table data The default value is false. The supported values are:

  • true
  • false
checksum

Verify checksum for backup files The default value is true. The supported values are:

  • false
  • true
dry_run

Does a dry-run restoration operation The default value is false. The supported values are:

  • true
  • false

Output Parameter Description

The GPUdb server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query. Here is a description of the various fields of the wrapper:

NameTypeDescription
statusString'OK' or 'ERROR'
messageStringEmpty if success or an error message
data_typeString'restore_backup_response' or 'none' in case of an error
dataStringEmpty string
data_strJSON or String

This embedded JSON represents the result of the /restore/backup endpoint:

NameTypeDescription
backup_namestringThe backup name
backup_idlongThe backup ID that was restored
restored_byteslongTotal size of data restored from backup
restored_countslongTotal number of records restored from backup
restored_objectsmap of string to stringsObjects that were successfully restored and their associated types.
renamed_objectsmap of string to stringsOriginal and new names of objects that were successfully restored and their associated types.
failed_objectsmap of string to stringsObjects that failed to be restored and their associated types.
infomap of string to stringsAdditional information.

Empty string in case of an error.