How to change location of Safetica database files

Follow these steps if you need to move Safetica database files within the same server:

A. Stop Safetica Server and prepare the new folder for database files

  1. Run the batch file "stop.bat" stored in the folder C:\Program Files\Safetica Management Service to stop Safetica Server.
  2. Create the new folder, for example E:\Safetica. 
  3. Set user rights for this folder for Authenticated users:
    Right-click on the folder - Security - Edit - Add - Authenticated users - choose Full control - save the settings.

B. 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_main database files
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_main.mdf
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_main_log.ldf
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\[safetica_main_FG].ndf
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
Safetica_category database files
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_category.mdf
C:\Program Files\Microsoft SQL Server\MSSQL13.SAFETICA\MSSQL\DATA\safetica_category_log.ldf

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

  1. In SQL Management Studio click on safetica_main - Tasks - Take offline (drop all connections).
  2. Repeat step 1 for all other Safetica databases (safetica_main, safetica_data, safetica_category).
  3. Open SQL Management Studio.
  4. Click on safetica_main database - New Query.
  5. Run the following commands individually (one at a time):

    ALTER DATABASE safetica_main MODIFY FILE ( NAME = safetica_main, FILENAME = 'E:\Safetica\safetica_main.mdf')
    GO

    ALTER DATABASE safetica_main MODIFY FILE ( NAME = safetica_main_log, FILENAME = 'E:\Safetica\safetica_main_log.ldf')
    GO

    ALTER DATABASE safetica_main MODIFY FILE ( NAME = '[safetica_main_FG]', FILENAME = 'E:\Safetica\[safetica_main_FG].ndf')
    GO

  6. Click on safetica_data  database - New Query.
  7. Run the following commands individually (one at a time):

    ALTER DATABASE safetica_data MODIFY FILE ( NAME = safetica_data, FILENAME = 'E:\Safetica\safetica_data.mdf')
    GO

    ALTER DATABASE safetica_data MODIFY FILE ( NAME = safetica_data_log, FILENAME = 'E:\Safetica\safetica_data_log.ldf')
    GO

    ALTER DATABASE safetica_data MODIFY FILE ( NAME = '[safetica_data_FG]', FILENAME = 'E:\Safetica\[safetica_data_FG].ndf')
    GO

  8. Click on safetica_category  database - New Query.
  9. Run the following commands individually (one at a time):

    ALTER DATABASE safetica_category MODIFY FILE ( NAME = safetica_category, FILENAME = 'E:\Safetica\safetica_category.mdf')
    GO

    ALTER DATABASE safetica_category MODIFY FILE ( NAME = safetica_category_log, FILENAME = 'E:\Safetica\safetica_category_log.ldf')
    GO

  10. Move the database files listed in part B. into the new folder (e.g. E:\Safetica).

D. Start Safetica database and server

  1. Open SQL Management Studio - click on safetica_main - Tasks - Bring Online.
  2. Repeat step 1 for all other Safetica databases.
  3. Run command "STAService -start" in the folder C:\Program Files\Safetica Management Service to start Safetica Server.
  4. Open Safetica Console and verify that you are able to connect to the server.