Ready to get started?Download WordPress


Advice wanted: setting up a test version of production site (10 posts)

  1. hooopla
    Posted 9 years ago #

    When my site goes into production I'd like to set up a second version of the site for testing purposes. I haven't done this before and would appreciate your comments.

    Here's what I think I should do:

    • Create a "test" directory.
    • Install a fresh instance of WP into that directory.
    • Point it at the same MySQL database as the production site.

    The test site would be used ONLY for changes to the site's appearance and not to modify anything in the database. Is sharing a database...

    1. possible?
    2. crazy?
    3. reasonable?

    Thanks in advance for your comments.

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    2. CRAZY - you WILL break your main site the instant you look at the production site.
    It's easy enough to fix back, but then it will happen again and again.

    Copy the db, import that into another set of tables and point the testblog at that :)

  3. hooopla
    Posted 9 years ago #

    OK. That sounds pretty definitive. Thanks, podz.

  4. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Just to clarify ........

    Let's say you install with a table_prefix of 'wp_'
    ONE blog can access that without issue

    If you configure another blog to use use the same details in the config file, but upload it to a different directory, your installs will break.

    But if you only have the one database ...........

    What you need to do is this:
    - Export the database
    - open the sql file in a text editor (a decent one)
    - run a find/replace which alters the table_prefix. One way to do this is to find and replace each table title in it's entirety:
    - be sure you have done that
    - import that into the single database you have
    - correctly create the wp-config.php file
    and do not run install.php

    If you are doing this it is extremely important that you BACKUP your files FIRST. You could do a lot of damage if you get things wrong.

  5. Root
    Posted 9 years ago #

    I dont know how much data the test blog really needs ? Just a thought.

  6. If you're only using it for site-testing appearances, then set up a secondary install using "dummy" data - i.e., make it totally seperate from your live blog, but import some old data, copy & paste a few entries in, or just make stuff up.

    I would totally not try sharing the database.

  7. revbob
    Posted 9 years ago #

    The test site would be used ONLY for changes to the site's appearance and not to modify anything in the database.

    If you really mean that, then what you need to do is put the changes into a new theme. You can access it something like this:


    And when it's all ready for the public, log in, go to the Presentation page, and set the new theme as the default.

  8. hooopla
    Posted 9 years ago #

    Thanks for all the feedback. I think revbob's suggestion is pretty much on the money, except that I don't want to skew my site stats. I'm not sure yet whether urchin can exclude hits originating from my own IP. So little time, so much to learn... ;-)

    I have lots of space on my server so I'm inclined to copy a chunk of production data, run a separate install, and just keep the theme in sync.

    In any case, you've given me some helpful alternatives. Many thanks!

  9. lawtai
    Posted 9 years ago #

    i'd set up a separate test blog with a different database that way you could not only test the look, but you could try out various plugins as well, which you wouldn't be able to with just a theme switcher.

  10. hooopla
    Posted 9 years ago #

    Good point, lawtai. I didn't think about that.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.