Skip to main content
Skip table of contents

Scheduling SQL Export Backups

You are looking at an older version of the documentation. The latest version is found here.

To create scheduled backups of the configuration database, you can use the export tool and the built-in scheduler of the Data Virtuality Server.

Windows

  1. Create a folder where you want to back up the dumps: drive:\path\to\backup.
  2. Create the script backup.bat containing the following:

    POWERSHELL
    cd drive:\path\to\backup\cli-export-1.0
    set hr=%time:~0,2%
    if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%
    .\export.bat  --username username --password password --host localhost --file ..\%date:~-4,4%-%date:~-7,2%-%date:~-10,2%_%hr%_%time:~3,2%_%time:~6,2%_config_backup.sql

    By default, the export tool is stored in C:\Data Virtuality Suite\DVServer\bin\cli-export-1.0.

  3. If you want to schedule the execution from within Data Virtuality Server, create an SQL job: 

    SQL
    EXEC SYSADMIN.CreateSQLJob
    (
       script => 'call SYSADMIN.execExternalProcess( ''drive:\\path\\to\\backup\\cli-export-1.0\\backup.bat'', null )',
       description => 'internal db backup to drive:\path\to\backup'
    );
    
    
  4. Add a schedule to this job in the jobs tab in the Data Virtuality Studio.

    All backups are stored in the drive:\path\to\backup folder

Linux

  1. Create a folder where you want to back up the dumps: /path/to/backup/dir.
  2. Create the script backup.sh containing the following:

    BASH
    #!/bin/sh
    OLDPWD=$PWD
    DIR=`dirname $0`
    cd $DIR
    ./export.sh --username username --password password --host localhost --file ../`date +"%Y-%m-%d_%H_%M_%S"`_config_backup.sql
    cd $OLDPWD

    By default, the export tool is stored in C:\Data Virtuality Suite\DVServer\bin\cli-export-1.0.

  3. Add execution permissions to backup.sh and export.sh (chmod a+x <file>).

  4. If you want to schedule the execution from within the Data Virtuality Server, create an SQL job:

    SQL
    EXEC SYSADMIN.CreateSQLJob
    (
       script => 'call SYSADMIN.execExternalProcess( ''/path/to/backup/dir/cli-export-1.0/backup.sh'', null )',
       description => 'internal db backup to path/to/backup/dir'
    );
    
    
  5. Add a schedule to this job in the jobs tab of the Data Virtuality Studio.

    All backups are stored in the drive:\path\to\backup folder.

JavaScript errors detected

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

If this problem persists, please contact our support.