Migration of Safetica database to a new SQL server

The following steps describe a correct procedure to migrate Safetica database from your current database to a new one.

Prerequisites

Available SQL Management Studio for both old and new SQL server.

Steps

  1. Deny clients from sending new logs and requests to the Safetica Management Service
    • Run CMD as administrator
    • Redirect to C:\Program Files\Safetica Management Service
    • Execute command: STAService.exe -clientport 44388
    • Execute command: STAService.exe -stop
    • Keep CMD opened
    • Open services.msc and verify that service STAservice.exe is stopped
  2. Transfer database files from the old SQL server to the new one.

//You can do so by copying already existing database files or using backup/restore feature.

  • Open MS SQL Management Studio and connect to the current database server
  • Right-click on database “safetica_data”, select “Tasks – Detach”
  • Check the box “drop connections” and confirm
  • Copy files: “safetica_data”, “safetica_data_log” and “[safetica_data_FG]” to the new SQL server

//Files are usually located at C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA or similar path. Location may vary, due to the custom installation parameters and SQL version.

  1. Attach/restore the database to a new SQL server
    • Open MS SQL Management Studio and connect to a new SQL server.
    • Right-click on Databases and select “Attach – add”
    • Navigate to the location of copied databases and select “safetica_data”
  2. Redirect Safetica Management Service to a new SQL server
    • If you’ve chosen the option to detach the databases, make sure to reattach them on old SQL server again
    • Go back to CMD
    • Execute command: STAService.exe -start
    • Open the Safetica Management Console and log in
    • Go to Profile -> Settings
    • Change the database connection string based on a new SQL server instance and click “Test connection”. If the “Successfully connected.” pop-up shows up, proceed with the “Finish” button at the bottom right corner.
  3. Re-enable the communication with clients
    • Execute command: STAService.exe -clientport 4438

Execute command: restart.bat