CML Backup tool

This article is describing the SafeQBackup.exe utility suited for backup of YSoft SafeQ CML server. The purpose of the article is to explain how to operate the utility.

To understand which data has to be backed up and what are the recommended means of backup kindly follow the instructions from article CML - Regular system backup.

SafeQ Backup tool

The Backup Tool must be started on the server with installed CML. It has support for backup local PostgresSQL, MSSQL and remote PostgresSQL.

Backup of remote MSSQL is limited due to nature of MSSQL backup. Backup Tool will provide you hint how to write backup SQL command in Messages window after click Show commands.

 

Tool location: <SAFEQ_DIR>\bin\SafeQBackup.exe

images/download/attachments/21955751/backuptool-5.png

The tool must be executed directly on the server which has YSoft SafeQ CML installed. Environment variable SAFEQ_HOME and <SAFEQ_DIR>\conf\cmldb.conf, <SAFEQ_DIR>\conf\cmldb-sqdw.conf configuration files are used by this tool. 

The tool has support for wildcards in file name. E.g.: it's possible to backup all files with file extension .config in all terminalserver subdirectory by following configuration: terminalserver\*.config

The tool also uses configuration file <SAFEQ_DIR>\conf\backup.conf which contains configuration of the tool. If the file does not exist, default configuration settings are used.

 

Password is not retrieved from config file. You have to enter it manually.

 

You can select databases to back up by selecting checkbox ahead of these lines: Database, Warehouse.

You can also back up YSoft SafeQ configuration and binaries by selecting checkboxes Configuration and Binaries

The backups are saved in directory <SafeQ_BackupDirectory>\backup_<yyyyMMddHHmm>.

 

Button Command to clipboard saves command for executing selected backup tasks from command line to clipboard.

Button Show commands will displays:

  • Command for executing selected backup tasks from command line

  • Commands executed by SafeQBackup tool after Backup button click.

Button Backup will perform backup operation. Tool will invoke backup commands. Black window may appear during database backup. Do not close this windows manually. Wait until operation is complete. Once this operation is complete then Messages will contain information from backup tools, including exit code of process. These messages might be useful for diagnostic.

Button Clear Messages clears textbox Messages.

MSSQL

MSSQL is able to create backup only on local drive where database engine is running.

When you uncheck Use command line tool checkbox, then backup tool will attempt to use internal driver to connect to database.

When you check Use Windows Authentication then command line backup will use Windows Authentication to SQL server instead of SQL autehntication.

Configuration backup

You can back up the configuration of CML. Select checkbox Configuration. When you click Backup then backup tool will perform a backup of directories specified in the Configuration textfield. Paths are relative to SAFEQ_HOME and delimited by semicolon. E.g.: conf;tomcat\conf will perform backup of C:\SafeQ5\conf and C:\SafeQ5\tomcat\conf. Output is stored into the zip file. Its name is shown on the same line in UI.

Binaries backup

You can back up binaries of YSoft SafeQ in the same way as configuration. Select the checkbox Binaries. When you click Backup then backup tool will perform backup of directories specified in the Binaries textfield. Paths are relative to SAFEQ_HOME and delimited by semicolon. Output is stored into the zip file. Its name is shown on the same line in UI.

Binary files cannot be backed up if they are in use. Therefore, if you wish to back them up you must stop corresponding services.


Max Roll Files Count

You can define the maximum count of created backups. By default 3 backups are stored. You can change it textbox Max Roll Count. If this value is set to zero, no backups are deleted. If this value is positive and count of backups exceeds it, the oldest backups are automatically deleted.

Back up from command line

Generate command from UI configuration

  • Configure SafeQBackup UI and click Show commands. Tool will generate line which you can use for manual execution from command line. The command is displayed in Messages box and introduced by : Command for executing selected backup tasks from command line. Copy next line to clipboard and store it e.g. to backup.bat which you can invoke from command line or from Windows task scheduler.

    images/download/attachments/21955751/backup_command.png
  • Alternatively, you can use Command to clipboard button to generate and store command to the clipboard.

Command line options

  • --console - run tool only in console mode, execute immediately. If this option is not present command line arguments will be loaded and displayed in UI, so you can check whether tool is configured properly.

  • --backupDir=<PATH> - path to directory where tool should store backups

  • --backupDb - create a database backup

  • --backupWarehouse - create a data warehouse backup

  • --backupConfig=<PATH>;<PATH> - create configuration directories backup and store them in zip file

  • --backupBinaries=<PATH>;<PATH> - create selected directories containing YSoft SafeQ binaries backup and store them into zip file.

  • --password=<STRING> - password to access the database

  • --useMSSQLConnection - use MSSQL connection from application, do not invoke backup using command line tools

  • --useWindowsAuth - use Windows Authentication - used when MSSQL is configured to use Windows Authentication credentials

  • --maxRollCount - sets maxRollCount, i.e. maximum count of created backups in directory. If set to zero, no files are deleted.

  • --backupToolPath=<PATH> - path to DB backup tool (e.g. pg_dump.exe or OSQL.exe)