Unable to migrate domains with databases on a remote database server

Refers to:

  • Plesk for Windows
  • Plesk for Linux

Created:

2016-11-16 13:22:20 UTC

Modified:

2016-12-21 20:34:03 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to migrate domains with databases on a remote database server

Symptoms

I am trying to migrate a domain which uses a database hosted on a remote database server, but the migration fails.

Cause

Plesk does not yet support the migration of domains with remote databases.

Resolution

The issue will be fixed in a future update for which a new Knowledge Base article will be created. You may subscribe to receive notifications about Plesk product updates.

Resolution

Two different workaround scenarios are available:

Scenario 1 (recommended):

You have not yet attempted to perform the migration.The remote database server is registered both on the source and target Plesk servers.

Workaround:

  1. Before starting the migration, do the following on the target server:

  2. Migrate the domains/clients which have remote MySQL databases.

  3. Restore the original DatabaseManager.php from the backup made in Step 1.

  4. Migrate the rest of the domains/clients.

  5. When the migration completes, follow the instructions from Step 1, but for the source server.

  6. (The most important step) Check whether the databases have been correctly deployed to the destination server.

  7. Remove the domains with remote MySQL databases from the source server.

  8. Restore the original DatabaseManager.php from the backup made in Step 5. This is mandatory to preserve the business logic.

Scenario 2 (easy, but not very safe):

You have not yet assigned the remote MySQL server to the destination server. The migration has already been performed, and the domain is no longer available on the source server.

Workaround:

Note: The domain must already be assigned to the local MySQL server.

  1. Assign the remote database server to the target PP server, and set it as default. After the migration, it will still contain the domains' databases, so we just need to replace the local database server with it.

  2. Interchange the IDs of the database servers in the psa.DatabaseServers table:

    mysql> select id,host from psa.DatabaseServers;
    +----+------------+
    | id | host |
    +----+------------+
    | 1 | localhost |
    | 2 | remote |
    +----+------------+

    Note: The exact commands are omitted.

  3. Remove (deassign) the local database server from the target PP server.

Have more questions? Submit a request
Please sign in to leave a comment.