/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 in a schema (excludes permissions, system configuration, host secret key, KiFS directories and user defined functions)
tableDatabase Table
credentialCredential
contextContext
datasinkData Sink
datasourceData Source
stored_procedureSQL Procedure
monitorTable Monitor (Stream)
userUser (internal and external) and associated permissions
roleRole, role members (roles or users, recursively) and associated permissions
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 all files copied for this snapshot
copied_fileslongTotal number of files copied for this snapshot
copied_recordslongTotal number of records in all files copied for this snapshot
total_number_of_recordslongTotal number of records that can be restored from this snapshot
infomap of string to stringsAdditional information.

Empty string in case of an error.