Migrate UserLock data from SQL Server to another

Move the UserLock database to a new SQL Server instance during an infrastructure change or upgrade, while preserving all existing data.

Published September 26, 2025

Introduction

In some situations, you may need to move the UserLock SQL database to a new server — for example during an infrastructure upgrade, hardware replacement, or when scaling up from SQL Express to a full SQL Server.

This guide explains how to migrate the database files and reconfigure UserLock to use the new SQL Server.

Before you start:

  • Make sure you have administrative rights on both SQL Server instances.

  • See Database architecture for details about how UserLock stores its data.

Steps

  1. Detach the database

    • On the current SQL Server, open SQL Server Management Studio with an account that has admin rights.

    • Right-click the UserLock database → Tasks ▸ Detach.


    • In the detach window, check Drop connections and click OK.



  2. Copy the database files

    • Copy the UserLock .mdf and .ldf files from the current server to the new one.



  3. Attach the database

    • On the new SQL Server, open SQL Server Management Studio.

    • Right-click DatabasesAttach….

    • Click Add…, select the copied UserLock file, then click OK.

  4. Change the UserLock production database

Best practices

  • Back up before migration: create a full backup of the UserLock database before detaching it.

  • Check integrity: after attaching on the new server, verify that all tables and data are present.

  • Secure the new environment: configure permissions and backups on the new SQL Server.

  • Archive the old files: keep a copy of the old database files in case rollback is needed.