Views: 143

To move the local SQL database to a remote SQL server, do the steps below:

 
For IMSec 1.6.5, the remote SQL server version should be SQL 2014 SP1 or above.
  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:
    • Trend Micro IM Security Server
    • Trend Micro IM Security System Attendant
  3. Detach the IM Security database using the following command:
    sqlcmd -S .\ IMSecurity -E -Q "sp_detach_db [IMSecurityDB_ SERVERNAME]"

    Replace "SERVERNAME" with your local host name where IM Security is installed.
    For example, the server name is LYNC15-SVR172, The commands should be:

    Detach Command

  4. Stop the SQL server (IMSecurity) service.
  5. Go to the SQL server Express DATA folder (e.g. ..\Microsoft SQL Server\MSSQLIMSECURITY\MSSQL\DATA).
  6. Copy the .mdf and the .ldf files to their respective folders on the remote SQL server. Refer to the image below:

    Local database:

    Local Database location

    Remote SQL server:

    Remote SQL Server location

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

    Connect to SQL Server

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

    SQL Management Studio

  9. Click Add and browse through the .mdf files. Select IMSecurityDB_LYNC15-SVR172.mdf, and then click OK.

    Locate Database Files

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

    You should see a dialog box similar to this:

    Attach Databases

  10. Click OK to attach the database. Make sure the IM Security service account have dbo on the IM Security database.

    Database Object Explorer

  11. Go back to the IM Security server and modify the IM Security database profiles by using the path \%IMSecurity_INSTALL_PATH%\config (e.g. C:\Program Files\Trend Micro\IM Security\config).
  12. Modify the following files to reflect the new remote SQL.
     
    Always back up the following files before making any modifications.
    • dbcfg_DatabaseInstance.txt
      This should match the remote SQL instance where you attached the IM Security databases. In my environment, it is “Lync15-SQL171\IMSInstance”
    • dbcfg_IsSeperateSQLServer.txt
      The value should be 1.
  13. Start the following services:
    • Trend Micro IM Security Server
    • Trend Micro IM Security System Attendant
  14. Open the IM Security console and verify if all the configurations are there and no errors on the console. And check all the logs can be queried successfully.