• A client has an existing WP installation.
  • I want to setup a dev/preview site that pulls same page/post content as existing site (and has same active plugins and settings), and I don't want the existing site to be affected.

How can I do this? Is is safe to do a separate WP install in a new directory and just feed it the same DB credentials (including WP table prefix) during the install process?

  • 1
    If you connect to the same DB, any content changes made on your dev site will be reflected in production. A copy of the DB gives you all of the content and settings w/o the risk of changes to the current site. – jdm2112 Oct 21 '15 at 19:57
  • Well...I want the content to be the same, between the sites, in case the client needs to update posts/pages (via existing site) during the dev process. For this phase of the project, I'll be focusing on framework/theme, rather than updating the content of the site. – Be Brilliant Oct 21 '15 at 20:10
  • I doubt it's possible to deny DB write abilities from your dev site. I could be wrong. If not, this means your "...I don't want the existing site to be affected" requirement is not possible if you simply share a DB. This is a very common situation when a new theme is needed for a site and when performing other dev tasks. Just pull a new copy of the DB every so often. It's unlikely the dev site needs to be 100% in sync with production site content. – jdm2112 Oct 21 '15 at 21:12

There are tools available for simplifying the synchronization of databases between multiple WP installations, such as WP Sync DB.

As @jdm2112 mentioned, using a copy of the database—versus attempting to use the same database—reduces the risk of development work interfering with the production environment. However, simply making a copy of one site's WP database is generally insufficient for using it on another site. You can read more about moving WordPress here.

| 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.