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

💻Safetica On-prem: How to migrate the Safetica database to a new SQL server

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

 

Applies to: Safetica On-Prem

 

Introduction

In Safetica On-Prem, all of your data (such as policies, logs, records, or settings) lives in a single MS SQL database called safetica_data. Migrating the database means pointing your existing Safetica Server at a fresh copy of safetica_data on the new SQL server. The data itself moves through a standard SQL backup and restore.  

 


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.
  • 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, so the reinstalled server matches the restored database.

       

       


      How it works

      The migration has four phases, done in order:

      1. Prepare the Safetica Server: Back up the Safetica certificate files, then uninstall Safetica Server. Learn more below.
      2. Prepare the new SQL server: Create an SQL user and enable mixed-mode authentication. Learn more below.
      3. Back up and restore the Safetica database: Back up safetica_data from the old SQL server and restore it on the new one. Learn more below.
      4. Reinstall Safetica Server: Reinstall against the new SQL server, restore the original certificates, and start the services. Learn more below.

       

       



      Step 1: Prepare the Safetica Server

      Save the certificate that identifies the Safetica Server to Safetica Clients, then uninstall the old Safetica Server.

      Back up the Safetica certificate files before uninstalling

      If you keep the original certificate files, every Safetica Client reconnects on its own after the migration and no further configuration will be needed.

      Backup Safetica certificate files

      1. Go to: C:\Program Files\Safetica Management Service
      2. Copy these three files to a secure location:
        • Safetica certificate
        • cert.pem
        • key.pem

       

      Uninstall Safetica Server

      1. Go to Apps & Features.
      2. Uninstall Safetica Server.
      3. Ensure that Safetica Management Service is also uninstalled. If it remains, uninstall it manually.

       

       



      Step 2: Prepare the new SQL server

      Set up the new SQL server so Safetica can connect to it with SQL authentication. 

      1. Open SQL Server Management Studio (SSMS) and connect to the new SQL server.
      2. Under the Security tab, create a new SQL user with sysadmin rights.
      3. Ensure the SQL Server authentication mode is set to Mixed Mode (Windows + SQL Authentication):
        • In SSMS, right-click the server instance and select Properties.
        • Go to Security.
        • Set authentication to SQL Server and Windows Authentication mode.

       

       



      Step 3: Back up and restore the Safetica database

      Move safetica_data from the old SQL server to the new one using a standard backup and restore.

      Create a backup of Safetica database

      1. Open SQL Server Management Studio (SSMS) and connect to the old SQL server.
      2. Right-click the safetica_data database and select Tasks > Back Up…
      3. Choose a backup location and create a backup file (.bak).

       

      Restore the database on the new SQL Server

      1. Open SQL Server Management Studio (SSMS) and connect to the new SQL server.
      2. Right-click Databases and select Restore Database… > Device.
      3. Select the .bak backup file you created.
      4. Restore the database as safetica_data on the new SQL server.

       

       



      Step 4: Reinstall Safetica Server

      Reinstall Safetica Server with the new SQL server, then put the original certificates back so your Safetica Clients reconnect.

      Reinstall Safetica Server

      1. Run the Safetica Server installer.
      2. Select Manual installation and component extraction, then select Safetica Server.
      3. Enter the new SQL Server hostname (and instance name, if applicable), SQL user credentials, and the password.
      4. Complete the installation.

       

      Restore certificates and start services

      1. Open the Services console (services.msc) and stop the following services:
        • Safetica Management Service
        • Safetica Service
      2. Delete the newly generated certificate files from C:\Program Files\Safetica Management Service.
      3. Copy your previously saved certificate files (cert.pem, key.pem, and Safetica certificate) back into that folder.
      4. Start Safetica Management Service and Safetica Service.

      About security accounts

      The DB_owner role is the minimum required role for basic functionality, except for automatic definition updates, record archiving, and advanced debugging. We do not recommend this setting.