I want to change a current site that already has a fairly robust database. Before I do, I want to test a few different layouts to make a decision. Instead of using the original site, I am thinking of changing the test site wp-config file to call the database from the original site. Can I do this without "damaging" the original site?

My rationale is that since the original site has custom post types, it would be easier to be able to use that database, rather than try to recreate it.


No, not in the manner that you're planning on doing it. Everything relating to the site (including the design, selected theme, etc) is stored in the database. By having a second site attach to it, any changes made there will be reflected on the main site.

| improve this answer | |
  • Not the answer I wanted, but glad to know before I did anything. Thank you. – Marna May 1 '11 at 19:03
  • that being said, you can make a duplicate version of your existing database, do a quick find / replace to change the URL to whatever test domain you're using, then go from there. – Norcross May 2 '11 at 0:28

You could just copy the DB using phpMyAdmin then point your test site to the new copy.

| improve this answer | |
  • Yeah, but then you have to post to each site if you want the beta to be up to date. – JakeParis Jun 28 '11 at 22:13

It is possible to run more than one site using the same database. You need to give each site its own database table prefix (see line:56-62 in wp-config-sample.php).

If you are only trying to test drive different themes then Theme Test Drive plugin is your friend. It will let you try out a different theme just for the Admin users.

If on the other hand you are going to be doing further development based on first site then you should look into WordPress OneClick Migration which will help you migrate site from one database to another.

| improve this answer | |

You can define the theme in wp-config.php to bypass the database settings.

define('TEMPLATEPATH', '/absolute/path/to/wp-content/themes/active-theme-or-parent-theme');
define('STYLESHEETPATH', '/absolute/path/to/wp-content/themes/active-theme-or-child-theme');

I'm using this in conjunction with Virtual Multiblog (with individual mb-config files) to run a test site from one database. But the theme-switcher plugin may be a neater solution.

(For some this reason the above works for the parent and child template files but not for style.css, so I edited header.php in the test child theme with the href of style.css directly in the HTML, eliminating the PHP call to the path.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.