Skip to main content
Skip table of contents

Backup Jobs

If you need to migrate between the CData Virtuality installations or want to have a backup of your data sources, jobs, settings, etc., you can use a special export script. It can be generated via the CData Virtuality Studio's Exporter component or via a CLI-exporter tool within the CData Virtuality Server.

The backup job is a system job that can be scheduled to create an export script on a regular basis in order to have an up-to-date backup at any moment. The backup jobs are run by a special system user - internal-backup which cannot be deleted.

Default Backup Job

By default, one instance of backup job is created. It cannot be deleted, but you can disable it if needed.

The default settings are as follows:

  • Daily run at 5.50 AM (CData Virtuality Server time);
  • Export scripts are stored in the backup directory in the server root folder.

You can edit the schedule for the backup job or delete it altogether and create a new one, just like for any other job. The backup directory can be changed using the SYSADMIN.editBackupJob system procedure.

Custom Backup Jobs

You can create additional backup jobs using the SYSADMIN.createBackupJob system procedure. These can be edited and deleted, and all settings are configurable.

Creating a Custom Backup Job

Here's the system function for creating a custom backup job. All parameters are optional except backupFolder:

SQL
CALL "SYSADMIN.createBackupJob"(
    "description" => 'string_description',
    "parallelRunsAllowed" => integer_parallelRunsAllowed,
    "retryCounter" => integer_retryCounter,
    "retryDelay" => integer_retryDelay,
    "runTimeout" => integer_runTimeout,
    "jobName" => 'string_jobName',
    "jarFileLocation" => 'string_jarFileLocation',
    "exportMattables" => boolean_exportMattables,
    "backupFolder" => 'string_backupFolder',
    "fileNamePattern" => 'string_fileNamePattern',
    "additionalProperties" => 'string_additionalProperties',
	"uuid" => 'string_uuid'
);; 

This procedure takes the following parameters:

To view the full table, click the expand button in its top right corner

ParameterTypeDescription

description

stringDescription of the job

parallelRunsAllowed

integerNumber of possible parallel runs allowed for the job

retryCounter

integer

Number of retry attempts for the job

retryDelay

integer

Delay between retries

runTimeout

integer

Job run timeout

jobName

string

Custom name for the job

jarFileLocation

string

Relative or absolute path to the cli-export.jar. Default: %dvserver%\bin\cli-export-1.0\

exportMattables

boolean

Flag indicating whether to export materialized tables

backupFolder

string

Relative or absolute path to the folder to store export scripts

fileNamePattern

string

Pattern to be used in file naming. Default: yyyy-MM-dd-HH_mm_ss_config_backup.sql

May include the following patterns:

  • $(dt): date+time in format yyyy-MM-dd-HH_mm_ss
  • $(uuid): uuid (time-based)
  • $(ut): unixtime

additionalProperties

key-value pairsAdditional properties of the CLI-exporter tool
uuidstringCustom UUID for the job

Here is an example of a call to create a custom backup job:

SQL
CALL "SYSADMIN.createBackupJob"(
    "description" => 'A custom backup job',
    "parallelRunsAllowed" => 1,
    "retryCounter" => 2,
    "retryDelay" => 3,
    "runTimeout" => 4,
    "jobName" => 'csmt-bckp-jb',
    "jarFileLocation" => '../bin/cli-export-1.0/cli-export.jar',
    "exportMattables" => true,
    "backupFolder" => '../custom_backup',
    "fileNamePattern" => '$(uuid)_custom_backup.sql',
    "additionalProperties" =>('--export-jboss-settings', 'true',),
	"uuid" => '7925969c-63cb-11ee-8c99-0242ac120002'
);;
uuid parameter in SYSADMIN.createBackupJob is available since v4.1

Editing a Backup Job

A backup job (both default and custom) can be edited with a special system procedure. All parameters are optional except biginteger_jobid:

SQL
CALL "SYSADMIN.editBackupJob"(
    "jobid" => biginteger_jobid,
    "description" => 'string_description',
    "parallelRunsAllowed" => integer_parallelRunsAllowed,
    "retryCounter" => integer_retryCounter,
    "retryDelay" => integer_retryDelay,
    "runTimeout" => integer_runTimeout,
    "jobName" => 'string_jobName',
    "jarFileLocation" => 'string_jarFileLocation',
    "exportMattables" => boolean_exportMattables,
    "backupFolder" => 'string_backupFolder',
    "fileNamePattern" => 'string_fileNamePattern',
    "additionalProperties" => 'string_additionalProperties',
	"jobUuid" => 'string_jobUuid'
);;

This procedure takes the following parameters:

To view the full table, click the expand button in its top right corner

ParameterTypeDescription

jobid

integerID of the job to be edited

description

stringDescription of the job

parallelRunsAllowed

integerNumber of possible parallel runs allowed for the job*

retryCounter

integer

Number of retry attempts for the job*

retryDelay

integer

Delay between retries*

runTimeout

integer

Job run timeout*

jobName

string

Custom name for the job

jarFileLocation

string

Relative or absolute path to the cli-export.jar. Default: %dvserver%\bin\cli-export-1.0\

exportMattables

boolean

Flag indicating whether to export materialized tables

backupFolder

string

Relative or absolute path to the folder to store export scripts

fileNamePattern

string

Pattern to be used in file naming. Default: yyyy-MM-dd-HH_mm_ss_config_backup.sql

May include the following patterns:

  • $(dt): date+time in format yyyy-MM-dd-HH_mm_ss
  • $(uuid): uuid (time-based)
  • $(ut): unixtime

additionalProperties

key-value pairsAdditional properties of the CLI-exporter tool
jobUuidstringUUID of the job to be edited
The jobId or jobUuid parameter must be specified.

* For more detail, please see parameters shared by job managing procedures.

Here is an example:

SQL
CALL "SYSADMIN.editBackupJob"(
	"jobid" => 8,
    "description" => 'A custom backup job',
    "parallelRunsAllowed" => 1,
    "retryCounter" => 2,
    "retryDelay" => 3,
    "runTimeout" => 4,
    "jobName" => 'csmt-bckp-jb',
    "jarFileLocation" => '../bin/cli-export-1.0/cli-export.jar',
    "exportMattables" => true,
    "backupFolder" => '../custom_backup',
    "fileNamePattern" => '$(uuid)_custom_backup.sql',
    "additionalProperties" =>('--export-jboss-settings', 'true',)
);;

jobUuid parameter in SYSADMIN.editBackupJob is available since v4.4

Additional Properties

To view the full table, click the expand button in its top right corner

OptionDefaultDescription

−−skip−aggr

FALSEIndicates whether to skip aggregation optimizations or not

−−ds−validation

FALSE

Indicates whether  to validate data sources on import or not. If enabled, data sources are exported with createDatasource/createConnection statements or importDatasource/importConnection otherwise.

Please note that the import will fail if validation is enabled and data source is unreachable

−−opt−validation

FALSE

Indicates whether  to validate optimizations on import or not. If enabled, optimizations are exported with createOptimization statements or importOptimization otherwise.

Please note that it's impossible to export materialized tables state if this validation is enabled

−−export−mattable−state

TRUE

Indicates whether  to export the state of materialized tables or not. Used when new CData Virtuality Server installation uses the same internal Analytical Storage database with materialized tables.

Please note that this option requires the optimization validation to be disabled

−−view−proc−validation

FALSEIndicates whether  to validate virtual views and procedures on import or not. If enabled, virtual views and procedures are exported by printing definitions directly to export script or wrapping with importView/importProcedure otherwise

−−use−maintenance−mode

FALSEIndicates whether  to run export in maintenance server mode

−−purge−system−data

FALSEIndicates whether  to purge the system data or not. If enabled, adds the script to purge the existing data at the beginning of the export script. With this option the following objects will be purged: DataSources, Connections, ProcDefinitions , VirtualSchemas, ViewDefinitions, ScheduleJobs (except cleanup and performance), Schedules (except performance), RecommendedOptimizations, Users, and Roles

−−use−model−file

FALSEIndicates whether  to use a different file for model export or not. If enabled, separate files will be used for the export of data sources, virtual schemas with views and procedures and the rest

−−export−jboss−settings

FALSEIndicates whether  to export JBoss settings or not. If enabled, JBoss settings are exported to separate files
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.