Sign In with your
Trend Micro Account
Need Help?
Need More Help?

Create a technical support case if you need further support.

Manually moving the local database of ScanMail for Exchange (SMEX) to a remote SQL server

    • Updated:
    • 1 Feb 2016
    • Product/Version:
    • ScanMail for Exchange 10.2
    • ScanMail for Exchange 11.0
    • Platform:
    • Windows 2003 Compute Cluster Server
    • Windows 2003 Datacenter
    • Windows 2003 Datacenter 64-bit
    • Windows 2003 Enterprise
    • Windows 2003 Enterprise 64-bit
    • Windows 2003 Home Server
    • Windows 2003 Server R2
    • Windows 2003 Small Business Server
    • Windows 2003 Small Business Server R2
    • Windows 2003 Standard
    • Windows 2003 Standard 64-bit
    • Windows 2008 Datacenter
    • Windows 2008 Datacenter 64-bit
    • Windows 2008 Enterprise
    • Windows 2008 Enterprise 64-bit
    • Windows 2008 Essential Business Server
    • Windows 2008 Server Foundation
    • Windows 2008 Server R2
    • Windows 2008 Server R2 with Hyper-V(TM)
    • Windows 2008 Small Business Server
    • Windows 2008 Standard
    • Windows 2008 Standard 64-bit
    • Windows 2008 Storage Server
Summary
Learn how you can manually migrate the SMEX database to a remote SQL server.
Details
Public

The recommended method of migrating the SMEX database is to specify the remote SQL server during a SMEX fresh installation. This will allow the SMEX installer to setup the ScanMail databases to the remote SQL server correctly, without having to do migration procedures.

To specify a remote SQL during a fresh installation:

  1. While the installer is checking the target server requirements, select the server link to configure the SQL server settings and then click Next.

    configure SQL server settings

  2. Tick the Specify an existing SQL server option and then enter the server name, the SQL server account, and the password. Click OK.

    specify an existing SQL server

    The installer will check the SQL server database.

    checking SQL server database

    The database created by the fresh installation will have the database in the Conf_Servername_GUID format.

    Conf_Servername_GUID format

Do the following procedure if SMEX is already installed using the local SQL server and you would like to move it to a remote SQL server:

  1. Click the Start button and type services.msc in the Search program and files field. The Services window will appear.
  2. Stop the following services:
     
    On a cluster environment, the ScanMail resource in the cluster administrator also needs to be offline.
    • ScanMail for Microsoft Exchange Master Service
    • ScanMail for Microsoft Exchange Remote Configuration Server
    • ScanMail for Microsoft Exchange System Watcher
  3. Go to the ScanMail for Microsoft Exchange Master Service properties and see if it has dependencies on the SQL Server (ScanMail).

    Exchange Master Service dependencies

  4. Remove the dependency to the SQL server.
    1. Open cmd.exe and type:

      sc config ScanMail_Master depend= ""

    2. Verify if SMEX still depends on the SQL server after the command was invoked. The Dependencies window should look like this:

      SMEX dependencies

  5. Detach the ScanMail database using the following commands:
    • sqlcmd -S .\ScanMail -E -Q "sp_detach_db [Conf_SERVERNAME]"
    • sqlcmd -S .\ScanMail -E -Q "sp_detach_db [Log_SERVERNAME]"
    • sqlcmd -S .\ScanMail -E -Q "sp_detach_db [Report_SERVERNAME]"
     
    Replace "SERVERNAME" with your local host name where SMEX is installed. For example: The server name is MBX-ONLY. The commands should be:

    detach ScanMail database

  6. Stop the SQL server (ScanMail) service.

    Go to the %SCANMAIL_INSTALL_PATH%\data folder, wherein “%SCANMAIL_INSTALL_PATH%\data” is the actual SMEX installation path.

    For cluster servers, use the following path:

    <sharedisk>\%SCANMAIL_INSTALL_PATH%\ data</sharedisk>

    Do this for each virtual server instance.

  7. Copy the .mdf and the .ldf files to their respective folders on the remote SQL server. Refer to the image below:

    copy .mdf files

    copy .ldf files

  8. On the remote SQL server, load the SQL Server Management Studio and login to the SQL instance where you want to attach the ScanMail databases.

    SQL Server Management Studio login

    Make sure you created an SQL Authentication login ID/Password.

  9. On SQL Server Management Studio, right-click Databases and select Attach.

    attach database

  10. Click Add and browse through the .mdf files. Under SMEX_DATA, select Conf.mdf and then click OK.

    select Conf.mdf

    Ensure that the Database Name and Attach As fields match the server name of the SMEX database. Database Name and Attach As fields

  11. Go back to the Locate Database Files window. Under SMEX_LOG, select the Conf_log.LDF file and you will notice the “Not Found” status. Click the “…” button and select the Conf_log.ldf file then click OK.

    select the Conf_log.LDF file

    You should see a dialog box similar to this:

    attach database

  12. Click OK to attach the database.
  13. Repeat Steps 9-12 for the other SMEX databases (Log & Report). Once you are done, you will see the databases listed like this:

    database attached

  14. Go back to the ScanMail server and modify the SMEX database profiles by using the path: \%SCANMAIL_INSTALL_PATH%\config.

    For clusters, use the path: <sharedisk>\%SCANMAIL_INSTALL_PATH%\config\.</sharedisk>

  15. Modify the following files to reflect the new remote SQL.
     
    Always back up the files before making any modifications.
    • dbcfg_DatabaseInstance.txt

      This should match the remote SQL instance where you attached the ScanMail databases.

    • dbcfg_IsSeperateSQLServer.txt

      The value should be 1.

    • dbcfg_SQLUserId.txt

      This should include the UserID you created for the ScanMail databases.

    • dbcfg_ServerName.txt

      This should match the ScanMail server name.

    • dbcfg_SecurityString.txt

      This should include the following: Persist Security Info=True;

    • dbcfg_InstallPath.txt

      This should include the correct path where the .mdf file is located on the remote SQL server.

    • dbcfg_SQLPassword.txt

      To generate the encrypted password:

      1. Go to the \%SCANMAIL_INSTALL_PATH%\SMEX folder.
      2. Type the command:

        toolChangeRemoteDBPWD.exe -p < sharedisk>\%SCANMAIL_INSTALL_PATH%\config\ -c Current SQL Password

      3. Type toolChangeRemoteDBPWD.exe /? to view the usage info.

        view usage info

  16. Go to \%SCANMAIL_INSTALL_PATH%\config\ and double-click the dbconf_Conf.xmlfile to see if has the correct variables. Refer to the image below:

    dbconf_Conf.xml variables

  17. Check the following config files. These files should be blank and not contain any info.
    • Dbcfg_ReportInitFileName.txt
    • dbcfg_LogInitFileName.txt
    • Dbcfg_ConfInitFileName.txt

    check the config files

  18. Start the following services:
    • ScanMail for Microsoft Exchange Master Service
    • ScanMail for Microsoft Exchange Remote Configuration Server
    • ScanMail for Microsoft Exchange System Watcher

    On clusters, access the ScanMail resource in the cluster administrator.

  19. Open the ScanMail console and verify if all the configurations are there and no errors on the console. The console should look like the screenshots shown below:

    SMEX console 1

    Click image to enlarge.

    SMEX console 2

    Click image to enlarge.

    SMEX console 3

    Click image to enlarge.

  20. Uninstall the SQL express locally from the SMEX server using the Add or Remove programs feature.

    uninstall 1

    Click image to enlarge.

    uninstall 2

    uninstall 3

Premium
Internal
Rating:
Category:
Configure; Troubleshoot; Deploy; Install
Solution Id:
1095817
Feedback
Did this article help you?

Thank you for your feedback!

To help us improve the quality of this article, please leave your email here so we can clarify further your feedback, if neccessary:
We will not send you spam or share your email address.

*This form is automated system. General questions, technical, sales, and product-related issues submitted through this form will not be answered.

If you need additional help, you may try to contact the support team. Contact Support


To help us improve the quality of this article, please leave your email here so we can clarify further your feedback, if neccessary:
We will not send you spam or share your email address.

*This form is automated system. General questions, technical, sales, and product-related issues submitted through this form will not be answered.


Need More Help?

Create a technical support case if you need further support.