Web Development

Issue With Moving WordPress From Localhost To Dreamhost

I was recently moving a small website from my localhost to the live server on Dreamhost using my standard deployment process.

Everything was running smoothly after installing WordPress on the live server, but when I migrated the database the installation screen came back. This was driving me crazy.

The issue

  1. I installed WordPress using “One-Click Installs” in Dreamhost admin panel.
  2. I uploaded theme, plugins and uploads folders to the live server and run the WordPress installation.
  3. The site was showing the default theme when viewed in the browser. Perfect.
  4. I used WP Migrate DB to export the database from my localhost.
  5. I dropped all tables in the current live database.
  6. And imported the database to the live server using phpMyAdmin.
  7. When I viewed the site in the browser again it did show the installation screen again. Hm that’s weird, I did this so many times before and never had the same issue. I repeated the whole process couple of times, thinking that I have made some mistake on the way. After few tries I got crazy, and you probably going crazy now.

Relax, the fix is very simple

Dreamhost by default sets the table prefix in the wp-config.php file to something like this:

// Dreamhost default table prefix
$table_prefix  = 'wp_ab23rB';

Your localhost wp-config.php looks probably something like this:

// Localhost default table prefix
$table_prefix  = 'wp_';

Fix the issue

  1. Simply change ‘wp_ab23rB’ to ‘wp_’ in the wp-config.php on your live server.
  2. Drop all tables and repeat database import in phpMyAdmin again.

You should now see the same site as you have developed on your localhost.

It took me some time to figure out what is going on, so I am putting it out here to save someone else’s time.

2 thoughts on “Issue With Moving WordPress From Localhost To Dreamhost

  1. Mala

    Thank you for posting this article. You saved me. I was working on my very first WordPress migration from localhost to DreamHost and this was the exact error that was a showstopper for me. Your article pointed me in the right direction to fix it & get up & running. Thank you!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.