How to Fix Moved WordPress Website Database Error

Many webmasters make the mistake of importing their wordpress website into a WordPress database cluster (typically on shared hosting). When this happens the website data is lost because WordPress cannot find the site’s database. The best practice here is to avoid using clusters with WordPress and instead use separate databases for each site.

If you have a WordPress database that was accidentally uploaded to a different server than the WordPress application, you will need to follow a few steps to get the database moved back to the app’s server.

Backup The Database

The first thing you should do after recognizing the error is to make a backup of your WordPress site’s database. To do this, login to your WordPress dashboard and navigate to DB Manager ➜ Databases. When the page loads, you will see the currently active database listed under the heading “Name”. You must click the “Create a Backup” button to create a backup. Once the backup has been created, you should download the file to your computer. Keep this file safe because it contains a lot of information about your site.

Import The Backup Into A Different Server

The next step is to import your backup file into a different server than the original WordPress application. Do this by logging into your WordPress dashboard and going to Settings ➜ Imports. When the page loads, you should find a button that says “Import Database” under the heading “Get Database Importer”. Click the button to install the plugin and when the page loads again you should see a button that says “Import Backup”.

To import your backup file, follow these steps:

  • Select the backup file you just downloaded from your WordPress dashboard
  • Click the “Import” button
  • Fill in the necessary information about your new server (e.g. the database name, user name, and password)
  • Click the “OK” button
  • The database will be imported into your new server and a message confirming the success of the operation will be displayed

Test The Import To Confirm It Worked

Once your database has been successfully imported on your new server, you should test to confirm everything is working fine. To do this, click the “Go Back” button (top right of the page) and you should see your WordPress dashboard with a message confirming the success of the operation.

If you received an email confirming the import of your database, you can click the link in the email to log into your WordPress dashboard and look at all the sites you just imported.

Fix The Configuration Mistake

When importing a WordPress database, the plugin automatically sets up the site with a default WordPress configuration. If you are using a hosting service that does not offer one-click WordPress installation (e.g. DreamHost), then you will need to make a few manual changes to the wp-config.php file to have a fully functioning WordPress site.

Before making any changes to this file, you should test the site in incognito mode to ensure the changes you make will not affect the live site (in case you make a mistake).

Remove Unnecessary Plugins

After you set up a new WordPress site with a default configuration, you will see a notice on the dashboard that plugins have been activated. These are the plugins that came with WordPress and are essential for a blog. You do not need to activate any of these plugins to have a functioning WordPress site.

If you found that your WordPress database was not imported successfully, then you should examine the plugins you have activated in order to see if there is an extraneous plugin that is preventing the import from going through. You should deactivate all the unnecessary plugins and try importing your database again. This may also require you to delete the contents of your wp-content directory and reimport your database.

Reset The WordPress Administration Password

If you are the owner of a WordPress site, then you have to reset the password for the WordPress administration area on your dashboard. This is where you can switch themes, plug-ins, and other customization options for your site.

Before resetting the password, you should examine the plugins you have activated to see if there is a forgotten password recovery plugin that can help you reset it. If that is the case, you should activate it and then reset the password for the WordPress administration area on your dashboard. Restoring the password will allow you to customize your site again.