ESET Online Help

Search English
Select the category
Select the topic

Database Server Backup and Restore

All ESET PROTECT On-Prem information and settings are stored in the database. We recommend that you back up your database regularly to prevent loss of data. You can use the backup later when migrating ESET PROTECT On-Prem to a new server. Refer to the appropriate section below for your database:


note

The names of databases and log files are staying same even after the change of the product name from ESET Security Management Center to ESET PROTECT On-Prem.

If you use ESET PROTECT Virtual Appliance, follow the VA database backup instructions.

Microsoft SQL Backup examples

To backup a Microsoft SQL database to a file, follow the examples shown below:


warning

These examples are intended for use with default settings (for example, default database name and database connection settings). Your backup script will need to be customized to accommodate any changes you have made to default settings.

You need to have sufficient rights to run the commands below. If you do not use a local administrator user account, you need to change the backup path, for example to 'C:\USERS\PUBLIC\BACKUPFILE'.

One time database backup

Execute this command in a Windows command prompt to create a backup into file named BACKUPFILE:

SQLCMD -S HOST\ERASQL -Q "BACKUP DATABASE ERA_DB TO DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'"


note

In this example, HOST stands for the IP address or hostname and ERASQL for the name of the Microsoft SQL server instance. You can install ESET PROTECT Server on a custom named SQL instance (when using Microsoft SQL database). Modify backup scripts accordingly in this scenario.

Regular database backup with SQL script

Choose one of the following SQL scripts:

a)Create regular backups and store them based on date of creation:

@ECHO OFF

SQLCMD.EXE -S HOST\ERASQL -d ERA_DB -E -Q "BACKUP DATABASE ERA_DB TO DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'

  WITH NOFORMAT,INIT, NAME = N'ERA_DB', SKIP, NOREWIND, NOUNLOAD, STOP_ON_ERROR, CHECKSUM, STATS=10"

REN BACKUPFILE BACKUPFILE-[%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%_T%TIME:~0,2%%TIME:~3,2%].bac

b)Append your backup to one file:

@ECHO OFF

SQLCMD.EXE -S HOST\ERASQL -d ERA_DB -E -Q "BACKUP DATABASE ERA_DB TO DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'

   WITH NOFORMAT, NOINIT, NAME = N'ERA_DB', SKIP, NOREWIND, NOUNLOAD, STOP_ON_ERROR, CHECKSUM, STATS=10"

Microsoft SQL restore

To restore a Microsoft SQL database from a file, follow the example shown below:

SQLCMD.EXE -S HOST\ERASQL -d ERA_DB -E -Q "RESTORE DATABASE ERA_DB FROM DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'"

MySQL backup

To backup a MySQL database to a file, follow the example shown below:

mysqldump --host HOST --disable-keys --extended-insert --routines -u ROOTLOGIN -p DBNAME -r BACKUPFILE


note

In this example, HOST stands for the IP address or hostname of the MySQL server, ROOTLOGIN for the root account of the MySQL Server, and DBNAME stands for ESET PROTECT database name.

MySQL restore

To restore a MySQL database from a file, follow the example shown below:

mysql --host HOST -u ROOTLOGIN -p DBNAME < BACKUPFILE


note

For more information on Microsoft SQL Server backup, please visit Microsoft technet website. For more information on MySQL Server backup, please visit MySQL documentation website.