how to transfer wordpress sql/database from local to live

I find the export tools very slow and not so reliable. If imporitng fails you probably have a timeout with your server or your dump file is too big.

Here’s the way I do it, and it’s much faster:

  1. extract a fresh copy of wordpress code in production
  2. replace the wp-content folder with the one from dev
  3. copy the wp-config.php from dev and verify the database connection settings
  4. do a full mysql dump of your development wordpress database
  5. import the dump into your production database
  6. if the domain used in dev is different from production run the following queries in production.

    UPDATE wp_options SET option_value = replace(option_value, ‘olddomain.com’, ‘newdomain.com’) WHERE option_value like ‘%olddomain.com%’;

    UPDATE wp_posts SET guid = replace(guid, ‘olddomain.com’,’newdomain.com’), post_content = replace(post_content, ‘olddomain.com’,’newdomain.com’);

Leave a Comment