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:
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:
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'" |
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' |
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' |
Microsoft SQL restore
To restore a Microsoft SQL database from a file, follow the example shown below based your environment:
•With an existing ERA_DB database:
SQLCMD.EXE -S HOST\ERASQL -d ERA_DB -E -Q "RESTORE DATABASE ERA_DB FROM DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'" |
•Without an existing ERA_DB database:
SQLCMD.EXE -S HOST\ERASQL -E -Q "RESTORE DATABASE ERA_DB FROM DISK = N'C:\USERS\ADMINISTRATOR\DESKTOP\BACKUPFILE'" |
MySQL/MariaDB backup
To backup a MySQL/MariaDB database to a file, follow the example shown below:
mysqldump --host HOST --disable-keys --extended-insert --routines -u ROOTLOGIN -p DBNAME -r BACKUPFILE |
For MariaDB backup, you can use mariadb-dump or mysqldump in the command.
In this example, HOST stands for the IP address or hostname of the MySQL/MariaDB server, ROOTLOGIN for the root account of the MySQL/MariaDB Server, and DBNAME stands for ESET PROTECT database name. |
MySQL/MariaDB restore
To restore a MySQL/MariaDB database from a file, follow the example shown below:
mysql --host HOST -u ROOTLOGIN -p DBNAME < BACKUPFILE |
For MariaDB restore, you can use mariadb or mysql in the command.
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. Follow the MariaDB Server documentation on Full Backup and Restore. |