Setting up a testing/staging WordPress environment

I’m not 100% sure where this topic belongs, so forgive me if it’s in the wrong spot.

Here’s my problem: I’ve set up a very basic WordPress testing environment by creating a subdomain and cloning my production site. However, I’d like to regularly update the test environment with the new content on my prod site.

How do I do that?

I’ve considered deleting and then re-cloning my prod site. I’ve also browsed this WPBeginner’s article, How to Create Staging Environment for a WordPress Site, which seems complicated but potentially doable.

Is there a simpler or better way that I’m unaware of?

Thanks in advance.

It would probably be best to clone the test environment to your prod site regularly. When cloning, it creates an identical copy of the installation, but you can install it in a different place. Installatron also makes this super easy; we have a guide for this as well over here: Easy Site Cloning within Installatron.

@mfierro thanks for the reply. I am hesitant to fall back on cloning, because it would wipe out a few specific settings and plugins that only need to be installed and activated on the test site (and vice versa). For instance, XML sitemapping needs to be turned off for the test environment, and I wanted different admin accounts for security.

I think I found a solution with the WordPress Importer plugin. I can export content from the prod site and import to the test site. Tried it out, and so far so good!

It’s hard to suggest w/o knowing the needs for the staging/dev site. As it sounds like you need to have the content copied in a place you can fiddle with settings/accounts, the import approach does sound best. Keep in mind the media will reference the production site, which is probably ok.

The WP Beginner article is more or less a manual approach to doing what the Installatron Cloner does. You can still run into problems with their approach because it’s more than just a search and replace on URLs; many theme options store things in arrays that are “serialized” in Wordpress. You can run into problems if the length of URLs differs between production and staging (using a dev.domain.org is a good idea as it will map okay to www.domain.org)

That’s why the Installatron Cloner is so awesome, it accounts for this difference too.

My preference for development and testing (following the lead of Rom Woodward) is to run Varying Vagrant Vagrants on my laptop. I run several test domains where you can do everything in WP you do on a server. This is most useful for doing design and plugin development, but it totally rocks. I can even do testing when I am offline (e.g. in a plane).

Nice to hear of one of our earliest DS106 students doing serious web stuff now! Hi Lee

1 Like

Good to know about the WP Beginner article, and the potential issue with the URLs.

Thanks for the Varying Vagrant Vagrants tip. I’ll check it out.

Hi Alan! :slight_smile: Well, semi-serious web stuff :slight_smile: