Skip to content
  • There are no suggestions because the search field is empty.

💻Safetica On-prem: How to migrate SQL server and Safetica Server

The following steps describe how to migrate Safetica database and Safetica server.

     

    Applies to: Safetica On-Prem

     

    Introduction

    This migration moves two things together:

    1. The Safetica database (the safetica_data database stored on your Microsoft SQL Server), which holds your records, settings, and configuration.
    2. The Safetica server components (Safetica Management Service and Safetica Maintenance Console), which run the server and the admin console.

    The goal is to move both to the new environment without losing data and without leaving devices with Safetica Clients stranded. 

     

     



    Prerequisites

    • Microsoft SQL Server Management Studio (SSMS) is installed on both the old and new SQL servers.

    • SQL Server 2025 is recommended for the new server.
    • Maintenance scripts:

    • You have admin access to the Safetica Server and to both the old and the new SQL servers.
    • The new SQL server has enough free disk space for the restored safetica_data database. 
    • You have the Safetica Server installer for the same version you currently run.

     

     


    How it works

    The migration follows a fixed order:

    1. Temporarily block Safetica Clients from sending logs.
    2. Run the maintenance scripts and redirect Safetica Clients to the new server address.

    3. Transfer the Safetica database files from the old SQL Server to the new one.
    4. Attach the database on the new SQL Server.
    5. Install the Safetica Server components on the new server.
    6. Re-enable communication with Safetica Clients on the old server, so devices can download the redirection settings.
    7. Keep the old server running until every device with Safetica Client has switched over to the new server. 

     

     


    Step 1: Block Safetica Clients from sending new logs 

    Stop the Safetica Clients from contacting the Safetica Management Service so that no new data arrives while you move the database.

    1. Run Command Prompt as administrator.
    2. Go to C:\Program Files\Safetica Management Service.
    3. Run command: STAService.exe -clientport 44388
    4. Run command: restart.bat
    5. Keep the Command Prompt open.

    ✍️ Changing the port to 44388 moves communication to a port the Safetica Clients do not use, which stops them from connecting. You restore the default port (4438) in Step 6.

     

     


    Step 2: Run the maintenance scripts and redirect Safetica Clients 

    Clean up the database with the maintenance scripts and point the Safetica Clients to the new server's address.

    1. Log into Safetica Maintenance Console.
    2. Go to Maintenance > Database management > Maintenance tab > Maintenance scripts section.
    3. Run both maintenance scripts: delete_license.dcf and delete_connections.dcf (download links available in Prerequisites above).
    4. Go to the Dashboard, right-click the user-tree root, and select Redirect to define the address to the new Safetica Server.

     

     


    Step 3: Transfer the database files from the old SQL Server to the new one 

    You can move the database either by copying the existing database files or by using the backup/restore feature. The steps below describe the copy method.

    1. Open Microsoft SQL Server Management Studio (SSMS) and connect to the old SQL server.
    2. Right-click the safetica_data database and select Tasks > Detach.
    3. Check the drop connections checkbox and confirm.
    4. Copy the following files to the new SQL server: safetica_data, safetica_data_log, and [safetica_data_FG]

     ✍️ The database files are usually located at: C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA or a similar path. Location may vary due to custom installation parameters and SQL Server version.

     

     


    Step 4: Attach the database on the new SQL Server 

    Bring the copied database online on the new SQL Server.

    1. Open Microsoft SQL Server Management Studio (SSMS) and connect to the new SQL Server.
    2. Right-click Databases and select Attach > Add.
    3. Navigate to the location of the copied database files and select safetica_data.

     

     


    Step 5: Install the Safetica Server components on the new server 

    With the database in place, install the Safetica sServer and connect it to the new database.

    1. Run the universal installer, choose Manual installation, and start the installation of Safetica Management Service.
    2. When prompted to select the SQL Server, choose the Custom SQL server option, and enter the connection string to the new SQL Server.
    3. Install Safetica Maintenance Console, log into the new Safetica Server, and complete the initial wizard.

     

     


    Step 6: Re-enable communication with Safetica Clients on the old server 

    Bring the old server back online so that devices with Safetica Client can download the redirection settings and learn the new server's address.

    1. Reattach the old database on the old server. This is necessary to allow the devices to download new redirection settings.
    2. In the Command Prompt you left open:
      1. Run command: STAService.exe -clientport 4438
      2. Run command: restart.bat

     

     


    Step 7: Keep the old Safetica Server running during the transition 

    Leave the old Safetica Server running until all required Safetica Clients have been redirected to the new server. Each Safetica Client picks up the redirection the next time it connects, so the old server must stay available until the last device has switched over.

    Exported reports may be lost during migration. To keep them, please copy them to the new server.