How to migrate a Microsoft SQL database to a new database server

Last updated on:

Objective

This article outlines the steps to migrate the back-end Microsoft SQL server database of ADSelfService Plus to a new Microsoft SQL server. This process keeps the existing ADSelfService Plus application server intact and only changes the database it connects to.

This migration is essential for common IT scenarios, such as decommissioning an old server, upgrading your SQL infrastructure, improving application performance, or relocating your database as part of a data center migration.

Prerequisites

Before starting the migration process, ensure the following:

  • You have administrator access to the ADSelfService Plus application server.
  • You have access to both the old and new Microsoft SQL servers.
  • You've made a full backup of the ADSelfService Plus installation directory.
  • The new SQL server firewall must have the same exceptions as the old server, allowing connections from the ADSelfService Plus application server.
  • You have sufficient privileges on both SQL servers to perform backup and restore operations.

Steps to migrate a Microsoft SQL database

Step 1: Back up and restore the SQL database

  1. On your current Microsoft SQL server, perform a full backup of the ADSelfService Plus database.
  2. Transfer the backup file to the new Microsoft SQL Server.
  3. On the new Microsoft SQL Server, restore the database from the backup file.
    Note:

    If prompted for a master key during restoration, contact ADSelfService Plus support to generate or retrieve it from the existing ADSelfService Plus application server.

    Step 2: Reconfigure ADSelfService Plus to connect to the new server

    1. Stop the ManageEngine ADSelfService Plus service via services.msc. This step is mandatory to prevent data corruption.
    2. Open Command Prompt as an administrator.
    3. Navigate to the bin directory within the ADSelfService Plus installation folder. The default path is C:\Program Files\ManageEngine\ADSelfService Plus\bin.
    4. Execute the database configuration script:
      changeDB.bat
    5. A Database Setup window will appear. Select MSSQL Server as the Server Type.
    6. Enter the Host Name of the new SQL server. The utility will automatically detect and list the available SQL Server instances.
    7. Select the correct Instance.
    8. Choose the appropriate Authentication method (Windows or SQL Server).
    9. Provide the necessary user credentials.
    10. To migrate your existing data to the new database server, check the Migrate Data From Existing Server checkbox. This option is available in build 6527 and later. Leave it unchecked if you are connecting to a freshly restored database with no additional data to migrate.
    11. Click Test to verify the connection to the new database.
    12. If the connection is successful, click Save. This will update the application's configuration files.
    13. Restart the ADSelfService Plus service.

    Validation and confirmation

    • Log in to the ADSelfService Plus admin and end-user portals.
    • Verify that all data, reports, and configuration settings are present and accurate.
    • Perform a test action – such as password reset or account unlock - to confirm the application is fully functional with the new database server.