Transferring WordPress sql data between localhost and production

There are quite a few blog posts around that provide helpful tips on transferring the sql data (all the posts and category content in the wordpress database) between your local development environment and production (live) site. This is something that needs to be done when making significant changes to the site design – especially when you need to see how real content will work with the new design.

I followed the tips, which basically are:

  • Use phpmyadmin or some other means of database access to export your database structure and content form the production site
  • Save as a text file
  • Find and replace all instances of your production url (http://mydomain.com) and replace with your localhost url. I use MAMP Pro so mine is http://localhost:8888/
  • Use a similar database access method to import the changed text file into your local database.

Then you just have to do the non-data releated:

  • FTP all the other files in wp_content from production to local
  • Change the local wp-config.php fileto point to your local db.

This didn’t work for me but I discovered the reason why. The bit that I have to add to this is to:

  • Also do a find and replace for any server path strings in the sql text file and replace with the local equivalent.

My server path on production was /hsphere/local/home/<username>/<sitename> which I had to replace with /Users/steve/Sites/<sitename>/.

So just one more little step.

This entry was posted in wordpress. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Posted February 10, 2013 at 11:32 am | Permalink

    D Minor:. Now among the advice of your educational
    materials, shoring jar discover all the things of the substitute chords.

    offers free online piano lessons.

  2. Posted February 19, 2013 at 4:52 pm | Permalink

    I will be most certainly of the perception a magic
    formula so that you can Doggie Behavior is top-notch level item that supplies a large number involving quality info for
    a surprisingly low value. This will help make navigating the weaving poles a habit for you dog.
    In 2005, Ford, a Gateway employee, decided it was time for a career change.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">