WordPress website migration from a locally hosted xampp platform to a live server.

Hello Support.

I currently have a locally hosted website that is running XAMPP/PHP/MySql on a Windows 7 PC. Having recently been given a job where I now need to migrate from the locally hosted site (localhost/xampp/knowledge-base) to a remote server, I am encountering problems.

The remote server is in the form of a Thecus N4100PRO NAS Drive (with a webserver module loaded) which is residing on my home LAN network.

I have migrated the database across from the localhost using the 'WP Migrate DB' plugin and used the respective URLs as suggested by the Thecus NAS Drive documentation.

The problem I have is that I keep on getting the error 'Error establishing a database connection' when I try to access the website upon migration. I've been trying to get this work all day; now I'm frustrated and tired......... and turned to you!

I attached some additional info for your perusal. Hopefully what I've provided will give you an idea of what's been done so far. If any additional information is required, I'll try and respond as soon as possible.

Regards, Edward.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey, Edward!

    Did you happen to edit your wp-config.php file to reflect the new database details? It looks like you've got everything else in order here, that's the one part I'd still suspect, since you didn't mention it.

    Take a peep at it via FTP and make sure all the MySQL details are up to date for the non-localhost site.

    If that's not it, there's more we can look at, but let's rule out the easy stuff first. :slight_smile:

  • Fred Bear
    • WPMU DEV Initiate

    Hi Michelle, and thanks for the quick response.

    Yes, I've had a look at the wp-config.php file - more often that I care to admit - and given that there are so many variables with this migration, I cannot see where I'm going wrong. I've copied the file for you to look at, as you're probably right: this may well be where my problem lies......

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey Fred!

    So sorry for the delay here. I've got some potential solutions for you.

    1. Are you getting the same database connection error on both the front and admin side of your site?
    If the error on the admin side says you have a database table that needs repair, you can attempt to do this yourself via wp-config.php. Simply add this line:

    define('WP_ALLOW_REPAIR', true);

    before the part of the config file that tells you to stop editing. Once that's saved, go to http://www.yoursite.com/wp-admin/maint/repair.php, and you'll see a tool that will attempt to repair your database tables for you.

    While you've got wp-config open, check to make sure the information for these four lines is correct:

    define('DB_NAME', 'database-name');
    define('DB_USER', 'database-username');
    define('DB_PASSWORD', 'database-password');
    define('DB_HOST', 'localhost');

    If this doesn't help, there are some more solutions offered in this post.

    This can be a tricky one to track down, I think all of us who spend time with WordPress have wrestled the server connection error bear before. Hopefully this will get you to a solution!

    Thanks, Fred!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.