/create/backup

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

Creates a database backup containing a current snapshot of existing objects.

Input Parameter Description

NameTypeDescription
backup_namestringName for this backup object. If the backup object already exists, only an incremental or differential backup can be made, unless recreate is specified
backup_typestring

Type of backup to create The supported values are:

  • incremental
  • differential
  • full
backup_objects_mapmap of string to strings

Map of objects to be captured in the backup. Error if empty and creating full backup. Error if non-empty when creating an incremental or differential backup.

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, backup the database key for encrypting secrets The default value is false. The supported values are:

  • false
  • true
configuration

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

  • false
  • true
datasink_namestringDatasink where backup will be stored.
optionsmap of string to strings

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

Supported Parameters (keys)Parameter Description
commentComments to store with this backup
checksum

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

  • false
  • true
ddl_only

Only save the DDL, do not backup table data The default value is false. The supported values are:

  • true
  • false
max_incremental_backups_to_keepMaximum number of incremental backups to keep. The default value is '-1'.
delete_intermediate_backups

When the backup type is differential, delete any intermediate incremental or differential backups. This overrides max_incremental_backups_to_keep The default value is false. The supported values are:

  • false
  • true
recreate

Replace the existing backup object with a new full backup if it already exists The default value is false. The supported values are:

  • false
  • true
dry_run

Dry run of backup The default value is false. The supported values are:

  • false
  • true

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'create_backup_response' or 'none' in case of an error
dataStringEmpty string
data_strJSON or String

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

NameTypeDescription
backup_namestringValue of input parameter backup_name.
backup_idlongBackup ID.
copied_byteslongTotal size of files copied to backup
total_recordslongTotal number of records in backup
infomap of string to stringsAdditional information.

Empty string in case of an error.