Saving databases

The roles of NoSpamProxy use the following databases:

  • Gateway Role NoSpamProxyGatewayRole
  • Intranet Role NoSpamProxyIntranetRole
  • Web Portal NoSpamProxyWebPortal

NOTE: If NoSpamProxy uses your existing standard or Enterprise SQL Server, you can configure a periodic backup of all databases there using the Enterprise Manager. When using SQL Server Express Edition, you must manually back up the database with a script and restore it if necessary.

Backing up the databases via the command line

Enter the following lines in the command line:

  • For the Gateway Role database
    osql -S (local)\NameOfTheInstance-E -Q "BACKUP DATABASE NoSpamProxyGatewayRole TO DISK = 'c:\NoSpamProxyGatewayRole.bak'" >
  • For the Intranet Role database
    osql -S (local)\NameOfTheInstance -E -Q "BACKUP DATABASE NoSpamProxyIntranetRole TO DISK = 'c:\NoSpamProxyIntranetRole.bak'" >
  • For the Web Portal database
    osql -S (local)\NameOfTheInstance -E -Q "BACKUP DATABASE NoSpamProxyWebPortal TO DISK = 'c:\NoSpamProxyWebPortal.bak'" >

These rows save the corresponding databases in files without shutting down the database for this purpose. You should therefore check whether you schedule an appropriately customized call as a regular task with Windows Task Scheduling.

Creating a backup

Enter the following lines in the command line:

  • For the Gateway Role database
    osql -S (local)\NameOfTheInstance -E -Q "RESTORE DATABASE NoSpamProxyGatewayRole FROM DISK = 'c:\NoSpamProxyGatewayRole.bak' WITH FILE= 1, NOUNLOAD, REPLACE "
  • For the Intranet Role database
    osql -S (local)\NameOfTheInstance -E -Q "RESTORE DATABASE NoSpamProxyIntranetRole FROM DISK = 'c:\NoSpamProxyIntranetRole.bak' WITH FILE= 1, NOUNLOAD, REPLACE "
  • For the Web Portal database
    osql -S (local)\NameOfTheInstance -E -Q "RESTORE DATABASE NoSpamProxyWebPortal FROM DISK = 'c:\NoSpamProxyWebPortal.bak' WITH FILE= 1, NOUNLOAD, REPLACE "

The databases must already exist in order for the recovery to work.

NOTE: Since the SQL server keeps the databases themselves permanently open, they cannot be captured via a normal backup of the files, such as via NTBACKUP.