0

I just received a backup of my WP site from the developer that includes the WP files and the database .sql file. I'm trying to install it on my server, but my WP build is ignoring wp-config.php. When I access domain.com/wp-admin I get Internal Server Error:

Steps I've taken:

  1. I uploaded the ZIP file with all WP files to the server and unzipped. Everything is now on the server, including /wp-admin, /wp-content, /wp-includes and so on...
  2. I created a new database with names that match the DB_NAME and DB_USER from wp-config.php below (except for the prefix).
  3. I uploaded the .sql file to the new database. Database is now populated.
  4. I updated wp-config.php so the database fields match my database. I had to update the prefix xxxx because it has to start with my hosting service's username. I kept the rest the same, including the password.
define( 'DB_NAME', 'xxxx_dbname' );       // Only updated prefix xxxx
define( 'DB_USER', 'xxxx_dbuser' );       // Only updated prefix xxxx
define( 'DB_PASSWORD', '[userPassword]' ); // I set the DB user password to match this one
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
$table_prefix = 'gw48ep_';    // This matches all tables on DB

I also reset all the 'AUTH_KEY's and salts to 'put your unique phrase here'.

When I visit my site, the content displays fine. But when I visit domain.com/wp-admin or /wp-login.php, I get:

Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request.`

I tried deleting wp-config.php and it doesn't change anything. It's like this file isn't being read by my WP installation. I also tried enabling debugging with

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

but my error_log file only shows old logs from two weeks ago.

What step am I missing? It's like my wp-config.php isn't even being read at all! Nothing I change on it makes any difference.

6
  • Was this backup running at the exact same URL you are trying to run it on? If the developer was working on localhost or a staging site, then if they did not use a migration plugin, the URLs throughout the database are trying to reference localhost and in fact need to be referencing your production domain. You can look in the wp_options table for two of the most common URL settings and see if those are correct - but in addition to those there will be lots of other references to the URL which in many cases are serialized, so just changing in the DB won't solve, you'd need to use a plugin.
    – WebElaine
    May 29, 2020 at 19:39
  • @WebElaine Thanks for bringing that up! The URL is the same, we just changed from one hosting service to another. So the IP is new, but the domain hasn't changed. However, I thought something would change if I delete wp-config.php from the server, but they both give me 500 Server error It must be another configuration file that's breaking the Wordpress build.
    – M -
    May 29, 2020 at 19:44
  • Have you confirmed that the DNS settings have propagated? Many times when you switch hosts it takes 2 or 3 days for the domain to fully point to the new host, so it could be trying to reach the old host or partly the old and partly the new (like seeing files on the old host but database on the new) while that's in progress.
    – WebElaine
    May 29, 2020 at 19:55
  • @WebElaine Interesting! The old IP started with 104.153.xxx.xxx, and I can confirm on my browser's Network tab that my HTML and assets are being fetched from the new IP 162.241.xxx.xxx:443 (It took about 5 hours for DNS propagation). However, I don't know how to check which database IP is being used. I thought they would be one and the same?
    – M -
    May 29, 2020 at 20:02
  • 1
    You could make a small change to a post or page directly in the new database, and then see whether that change appears on that post or page. If so, it's using the correct - new - database. If not, it's pulling from the old. (In phpMyAdmin, go to the prefix_posts table, edit a published Post or Page's post_content, and be sure to clear any caching plugins before checking.)
    – WebElaine
    May 29, 2020 at 20:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.