• The site I work for is moving to a new theme soon. To do some testing before going live with the new theme, we setup a WP install on a sub-domain, created a new database, and exported/imported our database from the live site into it to give us some content to look at. Since then, we’ve also added some things we don’t want on the live site to kick the tires on the new theme.

    Now, we’re ready to launch, and I want to figure out the best way to move the new theme over. We’ve made setting changes we want to keep on the test install, but we want to keep all the content just as it is on the live site. What is the best way to go about merging the two?

    I’ve thought of a few different methods.

    1. Install the theme and bring over the settings from the test site onto the live site. The problem here is that I’m not sure exactly where the settings are. I believe they are stored in the database somewhere.
    2. Export the content portions of the live database and import them into the test site database. Then, point the domain to the folder the test site resides in. The problem here is that it makes our directory structure a bit messy and leaves us using the test database as the live database. Not sure how much of a problem these things are, but they seem a bit sloppy.
    3. Install the theme on the live site and copy the settings over by hand. This seems simplest, but I feel there must be a better way.

    Which of these methods (if any) is the best? Is there a simpler/better way I’m missing entirely?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi raddevon,

    Here are my thoughts on the best strategy for moving your test site over to your live site:

    1. If you allow any user added content, disable that feature until you have completed your move.
    2. Export your live database.
    3. Backup and download your live site files and then remove those files.
    4. Following the steps here, move your test site files over to your live site’s directory:

    http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Within_Your_Site

    5. Import your old “live” database your exported in Step 2 into your new “live” database (testing database prior to move).

    This will move everything over from the testing site into your root directory.

    Thread Starter raddevon

    (@raddevon)

    Thanks, ChristiNi. This sounds great!

    Will your method also preserve settings we have made on the test site, or will we need to manually make those changes again?

    Thread Starter raddevon

    (@raddevon)

    I may have answered my own question. Just looking at the database, I don’t see anything there but site content. This leads me to believe the settings (theme options, URL settings, etc.) are probably stored in a file somewhere in the WP install. Can anyone confirm this?

    Thread Starter raddevon

    (@raddevon)

    Cancel that. Just saw the “Options” table. Maybe I should exclude that when I export from the live site database.

    The preferred way of doing is different for everyone. Here is how I go about doing it:

    1. Backup the database.
    2. Backup the wp-content folder.
    3. Create new database.
    4. Login to the new database. (Assuming you use phpmyadmin here)
    5. Import database into it
    6. Browse the wp_options table
    7. Change siteurl and blogurl to the new domain. Click OK each time.
    8. Upload the wp-content folder where the production site will be.

    Wala! But say you have images and links that still direct you to the test site? Search for a Plugin called “Search & Replace”. Do a search on your test domain and replace it with just your production domain url.

    Step 5 basically overwrites your testing database with the live one.

    Since theme settings are stored in the database, you’ll be able to activate the new theme, but the active one you’ll see will be the old one.

    @fonglh Thanks for pointing out the ambiguity of that line. I changed to note that the user would login to the new database set up.

    Once the user performs step 8, all plugins/themes will be there. Worst case scenario all the user has to do is go into Permalinks and click Save changes again.

    @brett

    Oops my reply was in response to Christini’s solution. The other posts came in while I was typing.

    Also, once he performs step 8, the plugins/themes will indeed be there, but all the theme customizations will be gone if he used the old database. And most of the content will be gone if he used the one with the theme customizations.

    @raddevon

    Try the first suggestion in your first post. As you’ve discovered, the settings are in the options table. Backup both databases first, so you can always start over if something goes wrong.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Best way to migrate test site to live site?’ is closed to new replies.