Restoring the Database

During its operation, Dr.Web Server regularly saves backup copies of important information: license keys, database contents, encryption private key, Dr.Web Server configuration and Control Center configuration.

The backup files are stored in the following folders:

for Windows OS: <installation_drive>:\DrWeb Backup

for Linux OS: /var/opt/drwcs/backup

for FreeBSD OS: /var/drwcs/backup

To perform the back-up, a daily task is included in the Dr.Web Server schedule. If such a task is missing in the schedule, it is recommended to create it.

All files in the backup except the database contents, are ready to use. The backup copy of the database is stored in the .gz format compatible with gzip and other archivers. The contents of the database can be imported from the backup copy to another Dr.Web Server database using the modexecdb database-import command. Thus the data can be restored.

info

To restore the database you can also use a backup created manually by the administrator via the Control Center in the Administration → Database management → Export (for the Export entire database mode only).

warning

You can restore the DB from the backup copy only if it was created via Dr.Web Server of the same major version as the version of Dr.Web Server that you use for restoring. For example, you can restore DB from the backup created via Dr.Web Server version 13 using Dr.Web Server version 13 only.

If for some reason the DB was corrupted during the Dr.Web Server upgrade from previous versions to version 13, please proceed as follows:

1.Remove Dr.Web Server version 13. Backup copies of files, used by Dr.Web Server, will be saved automatically.

2.Install the version of Dr.Web Server that was installed before the upgrade and that was used to create a backup copy.

According to the general upgrade procedure, you should use all saved Dr.Web Server files except the DB file.

Create a new DB during the Dr.Web Server installation.

3.Restore the DB from the backup according to the general procedure (see below).

4.Disable Dr.Web Agent, Dr.Web Server and the Network Installer protocols in the Dr.Web Server settings. To do this, select the Administration item in the main menu and click Dr.Web Server configuration in the control menu, go to the Modules tab and clear corresponding flags.

5.Upgrade Dr.Web Server to version 13 according to general procedure (see Administrator Manual, section Chapter 11: Updating Dr.Web Enterprise Security Suite Software and Its Components).

6.Enable Dr.Web Agent, Dr.Web Server and the Network Installer protocols, disabled in step 4.

Restoring the DB under Windows OS

info

The procedure for starting and stopping Dr.Web Server is described in the Administrator Manual, section Starting and Stopping Dr.Web Server.

To restore the DB from a backup copy

1.Stop Dr.Web Server if it is running.

2.Import the contents of the database from the corresponding backup file. The command will look as follows:

"C:\Program Files\DrWeb Server\bin\drwcsd.exe" -home="C:\Program Files\DrWeb Server" -var-root="C:\Program Files\DrWeb Server\var" -verbosity=trace -log="C:\Program Files\DrWeb Server\var\importdb.log" modexecdb database-import "<path_to_the_backup_file>\database.gz"

The command must be entered in a single line. It is assumed that Dr.Web Server is installed in the C:\Program Files\DrWeb Server folder.

3.Start Dr.Web Server.

To restore the DB from a backup copy when the Dr.Web Server version is changed (within the same major version) or the current DB version is corrupted

1.Stop Dr.Web Server if it is running.

2.Initialize a new database.

For the embedded DB:

a)Move the database.sqlite file to a temporary directory until you are sure that the database has been successfully restored.

b)In Windows the database initialization command will look as follows:

"C:\Program Files\DrWeb Server\bin\drwcsd.exe" -home="C:\Program Files\DrWeb Server" -var-root="C:\Program Files\DrWeb Server\var" -verbosity=all -log="C:\Program Files\DrWeb Server\var\initdb.log" modexecdb database-init

The command must be entered in a single line (see also drwcsd command format with the modexecdb database-init switch at the Appendix G3.3. Database Commands). It is assumed that Dr.Web Server is installed to the C:\Program Files\DrWeb Server folder.

c)Once this command is executed, a new database.sqlite will be generated in the var subfolder of Dr.Web Server installation directory.

For the external DB:

a)Export the database file to a temporary directory until you are sure that the database has been successfully restored.

b)Clean up the DB using modexecdb database-clean command (see Appendix G3.3. Database Commands).

3.Import the contents of the database from the corresponding backup file. The command will look as follows:

"C:\Program Files\DrWeb Server\bin\drwcsd.exe" -home="C:\Program Files\DrWeb Server" -var-root="C:\Program Files\DrWeb Server\var" -verbosity=trace -log="C:\Program Files\DrWeb Server\var\importdb.log" modexecdb database-import "<path_to_the_backup_file>\database.gz"

The command must be entered in a single line. It is assumed that Dr.Web Server is installed in the C:\Program Files\DrWeb Server folder.

4.Start Dr.Web Server.

Restoring the DB under UNIX OS

1.Stop Dr.Web Server (if it is running):

for Linux OS:

/etc/init.d/drwcsd stop

for FreeBSD OS:

/usr/local/etc/rc.d/drwcsd stop

2.Move database.sqlite to a temporary directory until you are sure that the database has been successfully restored. Database file is located in the following subfolder of the Dr.Web Server installation directory:

for Linux OS: /var/opt/drwcs/

for FreeBSD OS: /var/drwcs/

info

To clean an external DB, use the modexecdb database-clean command (see Appendix G3.3. Database Commands).

3.Initialize the Dr.Web Server database. The command will look as follows:

for Linux OS:

/etc/init.d/drwcsd modexecdb database-init

for FreeBSD OS:

/usr/local/etc/rc.d/drwcsd modexecdb database-init

4.After running this command, a new database.sqlite database will be generated in the var subfolder of the Dr.Web Server installation directory.

5.Import the contents of the database from the corresponding backup file. The command  will look as follows:

for Linux OS:

/etc/init.d/drwcsd modexecdb database-import "<path_to_the_backup_file>/database.gz"

for FreeBSD OS:

/usr/local/etc/rc.d/drwcsd modexecdb database-import "<path_to_the_backup_file>/database.gz"

6.Start Dr.Web Server:

for Linux OS:

/etc/init.d/drwcsd start

for FreeBSD OS:

/usr/local/etc/rc.d/drwcsd start

info

If you want to run the script with parameters (for example, specify the Dr.Web Server installation directory, etc.), change the appropriate values in the start script:

for FreeBSD OS: /usr/local/etc/rc.d/drwcsd

for Linux OS: /etc/init.d/drwcsd

If you need to change the log verbosity level of Dr.Web Server, use the local.conf file:

for Linux OS: /var/opt/drwcs/etc/local.conf;

for FreeBSD OS: /var/drwcs/etc/local.conf.

 

If some Dr.Web Agents were installed after the last backup had been made, they will not connect to Dr.Web Server after the database is restored from the backup. You should remotely reset them to Newbie mode. In the Administration menu → Dr.Web Server configuration on the General tab, set the Reset unauthorized to newbie flag and in the Newbies registration mode drop-down list, select Allow access automatically. Click Save and restart Dr.Web Server.

After all stations have been successfully connected to the new Dr.Web Server, change the settings of this Dr.Web Server to the settings adopted by your company policy.

 

As soon as the database is restored from the backup it is recommended to connect Dr.Web Security Control Center to Dr.Web Server. In the Administration menu, select Dr.Web Server Task Scheduler and make sure that the Back up critical server data task is included in the list. If this task is mssing, add it to the list.