Server-to-server migration

Server migration in ManageEngine SecureAI lets you move a SecureAI installation from one server to another while preserving its license, configuration, archived data, and database connection or database data, depending on the database setup. You might need to migrate during hardware upgrades, server decommissioning, operating system upgrades, data center relocations, or when moving from physical to virtual infrastructure. SecureAI supports three types of databases: the bundled PostgreSQL database that ships with the product, an external PostgreSQL database, and an external Microsoft SQL Server database. The migration approach differs depending on the database the product currently uses.

Prerequisites

Before starting, confirm the following:

  • You have administrative access on both the existing server and the new server. Administrative access is required to stop the product, copy the installation directory, and register SecureAI as a Windows service on the new server.
  • The latest supported build of SecureAI is installed on the existing server. Migrating from the latest build avoids version mismatches with the fresh installation on the new server.
  • Keep the license file accessible so you can apply the license again after SecureAI is started on the new server. Use the file sent to your registered email by licensing@manageengine.com at the time of purchase, or copy the applied license file from the lib folder in the installation directory.
  • If your installation uses Microsoft SQL Server as its back-end database and the SQL Server runs on a remote machine, the SQL Server Command Line Utilities, SQL Native Client, and ODBC Driver are installed on the new SecureAI server. Without these components, the new server cannot connect to the remote database.

How it works

SecureAI stores its operational data across several locations within its installation directory. The bundled PostgreSQL database holds primary product data if your installation uses that back end. The Archive, ES, and esdata folders hold archived data and the Elasticsearch search indexes. Configuration values, including the encrypted database password used by the bundled database backup, sit in the customer-config.xml file inside the conf folder. The license file named AdventNetLicense.xml is stored in the lib folder. When the installation uses an external PostgreSQL or Microsoft SQL Server database, primary product data lives on the external database server rather than inside the installation directory.

You can migrate the product using one of two approaches:

  • Move the existing installation: Stop SecureAI and copy the entire installation folder to the new server. The license, configuration, archived data, and bundled database move together because the directory structure is preserved as a whole. This approach is typically faster, but it requires the existing installation to be in a clean, working state.
  • Install SecureAI on the new server and restore data: Install a fresh copy of SecureAI on the new server, copy the supporting folders along with the configuration file from the existing installation, and then either restore a database backup or reconnect to the existing external database, depending on your setup.

The exact steps within each approach vary based on your database setup and installation build.

Configuration instructions

Depending on your requirements, you can take any of the following approaches:

Approach 1: Moving the existing installation to the new server

This method copies the entire SecureAI folder from the existing server to the new server.

  1. On the existing server, stop SecureAI if it is running.
  2. Open Command Prompt as an administrator and navigate to the bin folder in the SecureAI installation directory. The default installation path is C:\Program Files\ManageEngine\SecureAI.
  3. Run stopDB.bat to stop the database, and close Command Prompt.
  4. Copy the entire SecureAI folder to the new server.

    Note: Verify that the folder size on the new server matches the folder size on the existing server before continuing. A size mismatch usually indicates an incomplete copy.

  5. On the new server, open Command Prompt as an administrator and navigate to the bin folder inside the installation directory.
  6. Run the following command to install SecureAI as a Windows service: wrapper.exe -i ..\conf\wrapper.conf
  7. Connect the database that the existing installation uses:
    • If the existing installation uses the bundled PostgreSQL database, run initPgsql.bat from the bin folder.
    • If the existing installation uses an external PostgreSQL or Microsoft SQL Server database, run ChangeDB.bat from the bin folder and enter the connection details for the existing external database.
  8. Start SecureAI on the new server to verify the installation.

SecureAI now runs on the new server with the same license, configuration, and data as the existing installation.

Approach 2: Installing SecureAI on the new server and restoring or reconnecting the database

Use this method when you want a fresh installation on the new server and prefer to restore data from a database backup, or when you could not update the existing installation to the latest build.

For installations that use the bundled PostgreSQL database

  1. On the existing server, stop SecureAI if it is running.
  2. Open Command Prompt as an administrator and navigate to the bin folder inside the installation directory.
  3. Run backupDB.bat. SecureAI creates the backup as an EZIP file in the path configured as the backup storage path in the database settings.

    Note: The backup file is protected by the password set in the Security and Privacy page. If no backup password is configured, use the CryptTag value from customer-config.xml in the existing installation when the restore utility prompts for the backup password.

  4. From the existing server, copy the following items to a location accessible from the new server:
    • The Archive, ES, and esdata folders from the installation directory.
    • The customer-config.xml file from the conf folder inside the installation folder.
    • The backup file generated in the previous step.
  5. On the new server, download and install the latest build of SecureAI. On the final installer screen, clear the Start SecureAI in console mode check box, and click Finish.

    Note: Leaving this check box selected starts the product before the database is restored, which can cause the migration to fail.

  6. Paste the Archive, ES, and esdata folders into the installation directory on the new server, replacing the empty defaults.
  7. Replace the customer-config.xml file in the conf folder on the new server with the copy taken from the existing server.
  8. Paste the backup file into the bin folder on the new server.
  9. Open Command Prompt as an administrator, navigate to the bin folder, and run the following command: restoreDB.bat <backupFileName> -p
  10. When prompted, enter the backup password set on the existing server. If no password was set, paste the CryptTag value from the customer-config.xml file on the existing server.
  11. Start SecureAI on the new server.
  12. Click License to apply the original license file. Use the file you received from licensing@manageengine.com at the time of purchase, or copy the AdventNetLicense.xml file from the lib folder in the existing installation directory. View licensing guide.

For installations that use external databases

  1. On the existing server, stop SecureAI if it is running.
  2. From the existing server, copy the following items to a location accessible from the new server:
    • The Archive, ES, and esdata folders from the installation directory.
    • The customer-config.xml file from the conf folder inside the installation folder.
  3. On the new server, download and install the latest build of SecureAI. On the final installer screen, clear the Start SecureAI in console mode check box, and click Finish.
  4. Paste the Archive, ES, and esdata folders into the installation directory on the new server, replacing the empty defaults.
  5. Replace the customer-config.xml file in the conf folder on the new server with the copy taken from the existing server.
  6. Open Command Prompt as an administrator, navigate to the bin folder inside the installation directory, and run ChangeDB.bat. In the Database Setup Wizard, select the existing database type in Server Type, enter its connection details, and click Test Connection. If the test fails, an error message appears. Resolve the issue and test again before continuing.
  7. Start SecureAI on the new server.
  8. Click License to apply the license file. Use the license file you received at the time of purchase, or copy the AdventNetLicense.xml file from the lib folder in the existing installation directory. View licensing guide.

Tip: Do not uninstall SecureAI from the existing server until the installation on the new server is fully verified and working as expected. Keeping the existing installation intact gives you a fallback if anything goes wrong during the move.