0

I recently tried to back up my WP site to another (completely separate) web server. I ftp'd from Server 1, uploaded to Server 2, exported my SQL table from Server 1, imported to Server 2, and edited the wp_config.php on Server 2 to reflect the new site:

Database Configuration

define( 'DB_NAME', 'Server2Name' );

define( 'DB_USER', 'Server2Name' );

define( 'DB_PASSWORD', 'Server2Pass' );

define( 'DB_HOST', 'Server2Address' );

define( 'DB_HOST_SLAVE', 'Server2Address' );

define('DB_CHARSET', 'utf8mb4');

define('DB_COLLATE', 'utf8_unicode_ci');

$table_prefix = 'Server2TableName';

I also commented out a couple lines that mentioned Server 1, and uploaded it. It showed Error Establishing a Database Connection, but after adding define( 'WP_ALLOW_REPAIR', true );, I was able to reach the repair page.

Here's my issue: When Server 2 has the original wp_config.php file, it redirects to the site at Server 1. When edited, Server 2 returns Error Establishing a Database Connection, and so does Server 1. Even if I use the URL for Server 1 without making any edits on Server 1, changing the config file on Server 2 makes Server 1 reply Error Establishing a Database Connection.

I want to run the repair on Server 2 to fix it's settings, but since changes on Server 2 are (somehow??) preventing Server 1 from showing, I don't want to run anything without really messing things up.

I'd love to be able to have two separate, working copies.

  • Did you check the URLs in the wp_options table? They should be set to the proper URL for the site. – Rick Hellewell Sep 14 '17 at 17:51
  • I used a separate machine to try to reach the site at Server 1 when Server 2 was throwing the error, and both were down. – jlehenbauer Sep 14 '17 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.