Restoring the Database of Dr.Web Enterprise Security Suite

During the operation, Dr.Web Server regularly stores 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 into the Dr.Web Server schedule. If such 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 database backup copy is stored in the .gz format compatible with gzip and other archivers. The database contents can be imported from the backup copy to another database of Dr.Web Server using the modexecdb database-import command, thus restore the data.

info

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

Restoring the DB for Different Versions of Dr.Web Server

warning

You can restore the DB from the backup copy only if it had been 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 of 13 version using Dr.Web Server of 13 version only.

You cannot restore DB from the backup created via Dr.Web Server of 6 version using Dr.Web Server of 13 version.

If DB has been corrupted for some reasons during the Dr.Web Server upgrade from previous versions to 13.0 version, do the following:

1.Remove the Dr.Web Server software of the 13.0 version. Backup copies of files, used by Dr.Web Server, will be stored automatically.

2.Install Dr.Web Server of version, which had been installed before upgrading and had been used to create backup copy.

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

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

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

4.Disable the 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 the 13.0 version according to general rules (see Administrator Manual, p. Updating Dr.Web Enterprise Security Suite Software and Its Components).

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

For Windows OS

info

Procedure of how to start and stop Dr.Web Server is described in the Administrator Manual, p. Start and Stop Dr.Web Server.

To restore DB from backup

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

2.Import the content of the database from the correspondent backup file. The command line will look as follows:

for Dr.Web Server prior to version 13

"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=drwcsd.log importdb "<path_to_the_backup_file>\database.gz"

for Dr.Web Server version 13 and later

"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=drwcsd.log modexecdb database-import "<path_to_the_backup_file>\database.gz"

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

3.Start Dr.Web Server.

To restore DB from backup in case of changing Dr.Web Server version or corruption of the previous DB version

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

2.Remove the current DB. To do this:

2.1.For the embedded DB:

a)Remove database.sqlite file.

b)Initialize a new database. In Windows the command line will look as follows:

for Dr.Web Server prior to version 13

"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=drwcsd.log initdb D:\Keys\agent.key - - <password>

for Dr.Web Server version 13 and later

"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=drwcsd.log modexecdb database-init D:\Keys\agent.key <password>

The command must be entered in a single line (see also drwcsd command format with the modexecdb database-init switch at the Appendix H3.3. Database Commands). It is presumed that Dr.Web Server is installed to the C:\Program Files\DrWeb Server folder and agent.key license key is located in D:\Keys.

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

2.2.For the external DB: clean up the DB using cleandb (for Dr.Web Server prior to version 13) or modexecdb database-clean (for Dr.Web Server version 13 and later) command (see Appendix H3.3. Database Commands).

3.Import the content of the database from the correspondent backup file. The command line will look as follows:

for Dr.Web Server prior to version 13

"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=drwcsd.log importdb "<path_to_the_backup_file>\database.gz"

for Dr.Web Server version 13 and later

"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=drwcsd.log modexecdb database-import "<path_to_the_backup_file>\database.gz"

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

4.Start Dr.Web Server.

For 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.Remove database.sqlite from the following subfolder of the Dr.Web Server installation folder:

for Linux OS: /var/opt/drwcs/

for FreeBSD OS: /var/drwcs/

info

To clean an external DB, use cleandb (for Dr.Web Server prior to version 13) or modexecdb database-clean (for Dr.Web Server version 13 and later) command (see Appendix H3.3. Database Commands).

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

for Linux OS:

for Dr.Web Server prior to version 13

/etc/init.d/drwcsd -log=drwcsd.log initdb

for Dr.Web Server version 13 and later

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

for FreeBSD OS:

for Dr.Web Server prior to version 13

/usr/local/etc/rc.d/drwcsd -log=drwcsd.log initdb

for Dr.Web Server version 13 and later

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

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

5.Import the content of the database from the correspondent backup file. The command line will look as follows:

for Linux OS:

for Dr.Web Server prior to version 13

/etc/init.d/drwcsd -log=drwcsd.log importdb "<path_to_the_backup_file>/database.gz"

for Dr.Web Server version 13 and later

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

for FreeBSD OS:

for Dr.Web Server prior to version 13

/usr/local/etc/rc.d/drwcsd -log=drwcsd.log importdb "<path_to_the_backup_file>/database.gz"

for Dr.Web Server version 13 and later

/usr/local/etc/rc.d/drwcsd -log=drwcsd.log 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 (e.g., set the Dr.Web Server installation directory and etc.), you must make all changes 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 level of detail 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 Agents were installed after the last backup had been made, they will not be connected to Dr.Web Server after the database has been restored from the backup. You should remotely reset them to the newbie mode. In the Administrating → 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 will be successfully connected to the new Dr.Web Server, change these Dr.Web Server settings to the settings adopted according to the policy of your company.

 

As soon as the database is restored from the backup it is recommended to connect Dr.Web Security Control Center to Dr.Web Server. On the Administration menu, select Dr.Web Server Task Scheduler and check that the Back up critical server data task is on the list. If this task is absent, add it to the list.