You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Create a Backup via Command Line

You can make a backup at any time manually (even when the custo diagnostic server is running). To do so, you need the password of the database, as in "Restore the Backup". The following command is used for this:

Command
"Path-to-mysql-bin-Directory"\mysqldump.exe -uroot -p<Passwort> -r "Path-to-Backup-Files"\backup.sql diagdb
Example
"C:\Program Files\custo diagnostic server\mariadb\bin\mysqldump.exe" -uroot -pSECRET -r "C:\diagserverdata\backup\2020-04-22-002.db.backup.sql" diagdb

This command creates the file backup.sql which contains a backup of the database diagdb.

Create a Backup via Service Center

custo diagnosic Users who have access to the custo Service Center can start a Backup immediately via the daily planned backup task.

You have to login to the custo Service Center and open the menu "Tasks" and click on "Scheduler" (1).
Than you have to search in the left pane the task "backupDB" (2).
Single click on the task and click on "Start" (3).

The custo diagnostic server will create an backup of the database immediately. The task has finished when a new zip file for a backup exists. Please Note: No progress bar will be displayed here.

Restore the Backup

In the diagserverdata directory there are SQL scripts in the "backup" directory that represent a backup of the entire custo diagnostic database in MariaDB. These scripts can be used for reimport and backup purposes. However, it may be necessary to make a backup before importing the backup itself (see "Create a Backup")

Please run the following instructions in a Windows CMD Shell as administrator.
First the diagserver must be shut down:

Command
net stop diagserver

But the service "diagserverdb" (i.e. MariaDB) must still be running!

Now you can import the backup file with the following command to overwrite the database with the backup. For this we need the password for the database. You will find the password in the file "conf\diag.properties" located in the custo diagnostic server installation directory. This file contains the entry diag.dbPass=[...]. The password is the characters after the "=".

We first change to the directory with the backup files. Than execute the mysql command located in the installation directory of the custo diagnostic server below "mariadb\bin".

Command
"Path-to-mysql-bin-Directory"\mysql.exe -uroot -p<Password> diagdb < "Path-to-Backup-Files"\YYYY-MM-DD.db.backup.sql
Example
"C:\Program Files\custo diagnostic server\mariadb\bin\mysql.exe" -uroot -pSECRET diagdb < "C:\diagserverdata\backup\2020-04-22.db.backup.sql"

This would bring back the backup from DD.MM.YYYY. Please replace this with the filename with the backup you will have to restore. Please note:

  • The password comes after -p but without spaces!
  • The user comes after -u without spaces and is always root
  • After the password comes the name of the database, which is called diagdb

Afterwards you can start the custo diagnostic server:

Command
net start diagserver
  • No labels