How to move the PureMessage for Microsoft Exchange databases to a different SQL Server

  • Article ID: 36323
  • Rating:
  • 3 customers rated this article 2.3 out of 6
  • Updated: 02 Dec 2014

This article describes how to move the four PureMessage databases to a different SQL server. You may need to do this if for example the SQL server is running out of disk space or if its version is no longer supported.

Note: This article uses Transact-SQL (TSQL) commands to ensure the correct configuration is being applied, and to eliminate any possible incompatibility caused by different versions of SQL management applications. The same steps can be performed using a SQL management application, though TSQL is the advised option.

Applies to the following Sophos product(s) and version(s)

PureMessage for Microsoft Exchange

What To Do

Before you start

This process requires you to stop and disable the PureMessage services while the databases are moved, to ensure that no data is attempted to be read/written from the SQL databases during the move. As the PureMessage scanning processes will be offline, this article advises that the related Exchange processes are also stopped. It is therefore advised that you perform this process in a maintenance window or similar period.

Note: You should make a backup of the PureMessage databases before continuing, though as the SQL detach/attach method is used in this article the databases can be re-attached to the original SQL server if required.

You will need the below details before performing the database moves:

  • The folder paths where PureMessage is installed in your environment, this article uses the default:

    C:\Program Files\Sophos\PureMessage\

  • Your Windows NetBIOS Domain name, this article uses DOMAIN, change this to your domain
  • The SQL servers which you are moving the databases to and from, in this article they are referred to as below:

    The SQL server which you are moving the databases from:

    SQLSERVER1\ORIGIN or 'origin SQL server'

    The SQL server which you are moving the databases to:

    SQLSERVER2\DESTINATION or 'destination SQL server'

  • The folders where the database files (.mdf &.LDF) are stored on the origin and destination SQL servers, for example:

    C:\Program Files\Microsoft SQL Server\MSSQL10.ORIGIN\MSSQL\DATA\

    C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\

    Note: The above paths are used throughout this article, change these to the actual paths on your SQL servers

Check the SQL Server versions are compatible

Confirm the SQL server version on the destination SQL server is the same or higher than the version on the origin SQL server.

  1. Run the below commands on the origin SQL server:

    C:\SQLCMD -E -S SQLSERVER1\ORIGIN

    1> SELECT @@VERSION
    2> GO


  2. Run the below commands on the destination SQL server:

    C:\SQLCMD -E -S SQLSERVER2\DESTINATION

    1> SELECT @@VERSION
    2> GO


  3. Confirm the destination SQL server's version is the same as or higher than the origin SQL server, if lower then a different SQL server needs to be selected

Stop and disable the required PureMessage and Exchange services

Perform the below steps on every Exchange/IIS server running PureMessage which is using the origin SQL server:

  1. [Exchange 2003 only] Stop the Simple Mail Transfer Protocol (SMTP) service
  2. [Exchange 2007 and above] Stop the Microsoft Exchange Transport service
  3. Stop the Microsoft Exchange Information Store service
  4. Stop and disable all PureMessage services
  5. [Cluster or DAG] Take all Exchange and PureMessage cluster resources offline

Note: These steps need to be performed on all Exchange/IIS servers running PureMessage which are using the origin SQL server.

Move the PureMessage databases using the SQL Detach/Attach method

  1. Run the below commands on the origin SQL server:

    C:\SQLCMD -E -S SQLSERVER1\ORIGIN

    1> USE master;
    2> GO

    1> EXEC sp_detach_db @dbname = N'SavexCnfg';
    2> GO
    1> EXEC sp_detach_db @dbname = N'SavexDir';
    2> GO
    1> EXEC sp_detach_db @dbname = N'SavexRprt';
    2> GO
    1> EXEC sp_detach_db @dbname = N'SavexQuar';
    2> GO


  2. On the origin SQL server, browse to:

    C:\Program Files\Microsoft SQL Server\MSSQL10.ORIGIN\MSSQL\DATA\

  3. Copy the below 8 files onto a network share or removable drive:

    SavexCnfg.mdf
    SavexCnfg_log.LDF
    SavexDir.mdf
    SavexDir_log.LDF
    SavexRprt.mdf
    SavexRprt_log.LDF
    SavexQuar.mdf
    SavexQuar_log.LDF


  4. On the destination SQL server, browse to:

    C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\

  5. Copy the below 8 files from the network share or removable drive into this directory:

    SavexCnfg.mdf
    SavexCnfg_log.LDF
    SavexDir.mdf
    SavexDir_log.LDF
    SavexRprt.mdf
    SavexRprt_log.LDF
    SavexQuar.mdf
    SavexQuar_log.LDF

Attach the databases to the destination SQL server

  1. Run the below commands on the destination SQL server:

    C:\SQLCMD -E -S SQLSERVER2\DESTINATION

    1> USE master
    2> GO

    1> CREATE DATABASE SavexCnfg
    2> ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexCnfg.mdf'),
    3> (FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexCnfg_log.LDF')
    4> FOR ATTACH
    5> GO

    1> CREATE DATABASE SavexDir
    2> ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexDir.mdf'),
    3> (FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexDir_log.LDF')
    4> FOR ATTACH
    5> GO

    1> CREATE DATABASE SavexQuar
    2> ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexQuar.mdf'),
    3> (FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexQuar_log.LDF')
    4> FOR ATTACH
    5> GO

    1> CREATE DATABASE SavexRprt
    2> ON (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexRprt.mdf'),
    3> (FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL10.DESTINATION\MSSQL\DATA\SavexRprt_log.LDF')
    4> FOR ATTACH
    5> GO

Create a Login for the SophosPureMessage account on the destination SQL server

  1. Run the below command on the destination SQL server:

    C:\SQLCMD -E -S SQLSERVER2\DESTINATION

    1> CREATE LOGIN [DOMAIN\SophosPureMessage] FROM WINDOWS;
    2> GO

Edit the LocalConfig.xml file on the Exchange/IIS servers

These steps need to be performed on every Exchange/IIS server running PureMessage which was using the origin SQL server:

  1. Log on locally to one of the Exchange/IIS servers
  2. Browse to the below folder:

    C:\Program Files\Sophos\PureMessage\Config\LastKnown\

  3. Make a backup copy of the LocalConfig.xml file
  4. Open the LocalConfig.xml file using Windows Notepad
  5. In the 'Edit' menu, select 'Replace...'
  6. Enter the below details in the dialog box:

    Find what: SQLSERVER1\\ORIGIN

    Replace with: SQLSERVER2\\DESTINATION

    Note: The separator is \\ not \

  7. Click the 'Replace All' button
  8. Save the file and exit Notepad

Note: These steps need to be performed on all Exchange/IIS servers running PureMessage which were using the origin SQL server

Start the PureMessage and Exchange services

Perform the below steps on every Exchange/IIS server running PureMessage which was using the origin SQL server:

  1. [Exchange 2003 only] Start the Simple Mail Transfer Protocol (SMTP) service
  2. [Exchange 2007 and above] Start the Microsoft Exchange Transport service
  3. Start the Microsoft Exchange Information Store service
  4. Set all PureMessage services to the 'Automatic' Startup type then start them
  5. [Cluster or DAG] Bring all Exchange and PureMessage cluster resources online

Note: These steps need to be performed on all Exchange/IIS servers running PureMessage which were using the origin SQL server

Confirm the database move has been successful

  1. Log on locally to one of the Exchange/IIS servers where you edited the LocalConfig.xml
  2. Open the PureMessage administration console (MMC)
  3. Check that the console displays correctly without errors
  4. Repeat this step on the remaining Exchange/IIS servers

 
If you need more information or guidance, then please contact technical support.

Rate this article

Very poor Excellent

Comments