How to change location of Safetica database files

 

Information in this article applies to Safetica ONE 10 or older.

1. Stop Safetica server services and prepare the new folder for database files

  1. Open services and stop both Safetica Management Service and WebSafetica service. If the Safetica Management Service is not present on the list, go to "C:\Program Files\Safetica Management Service" and run the stop.bat script.
  2. Create a new folder, for example - E:\Safetica. 
  3. Set folder's permission so the SQL server can operate with this new destination. You can either set permission for:
    1. MSSQL Service - full control
    2. Or, Authenticated users:
      Right-click on the folder - Security - Edit - Add - Authenticated users - choose Full control - save the settings.

2. Verify the location of Safetica database files

The default location of Safetica database files is listed below. Verify that the files are available in this location (may differ based on your version of MS SQL Server) as they will be moved in the next step:

Safetica_data database files
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_data.mdf
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_data_log.ldf
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\[safetica_data_FG].ndf

3. Move the database files to the new folder and change the path in the database

  1. Open SQL Management Studio.
  2. Right-click the database safetica_data, choose Task -> Detach, tick the "Drop connections" option and finish the detach with "Ok". 
    1. Please note that since Safetica version 9, we no longer use databases with postfix _main and _category. If these databases are still present and you already upgraded, feel free to delete them directly from the SQL Studio.
  3. Move the database files listed in step 2 into the new folder (e.g. E:\Safetica).
  4. Right-click the folder "Databases" in the SQL Management studio, choose the option "Attach" and select the safetica_data.mdf database from the new destination. 

D. Start Safetica database and server

  1. Start the WebSafetica service and Safetica Management Service using the Services or in case of missing Safetica Management Service, use the script restart.bat located in the same folder as the stop.bat.
  2. Open Safetica Console and verify that you are able to connect to the server.