Create a dev copy of your WordPress site with WordOps

WordOps is a popular framework to setup and manage WordPress infrastructure, forked from EasyEngine in 2018 when EasyEngine v4 changed their architecture to use Docker containers.

This is a quick guide to setting up a development copy of your live WordPress site which can be useful if you’re working on a redesign or testing new themes.

If you’re not familiar with the WordPress CLI (WP), it does some magic behind the scenes to extract the database connection details from wp-config.php, so as long as we’re in the directory of a WordPress installation it will figure out what to do.

1. First, we’ll create the new site ( as a WordPress site with Let’s Encrypt enabled

sudo wo site create --wp --le

2. Next, we’ll cleanup the default content on the newly created dev site and copy the files from the production site

sudo rm -rf /var/www/*
cd /var/www/
sudo cp -a * /var/www/

3. Now we can use the WP CLI to export the database from the production site and import it to the dev site.

sudo -u www-data -H wp db export ~/ --yes
cd /var/www/
sudo -u www-data -H wp db clean --yes
sudo -u www-data -H wp db import ~/ --yes
rm ~/

4. Finally use WP CLI to update the WordPress URLs on the dev site

sudo -u www-data wp option update home ''
sudo -u www-data wp option update siteurl ''

The dev copy of your site should now be available. Depending on the nature of the site it could be sensible to password protect the site or restrict traffic to the dev site by IP address.

Restricting access by IP address

Open the nginx configuration for the new site:

sudo wo site edit

Then before the closing brace add:

allow <Your IP>;
deny all;

Save the changes to the file and check nginx reloads correctly, access to the site should now be restricted to your IP address.

Pushing changes back to production

You can promote your dev site to production by following the instructions the other way around.

One response to “Create a dev copy of your WordPress site with WordOps”

  1. Kamron N. Avatar

    Great tutorial! I recently switched to Webinoly for a few sites because of their easy dev server commands, but I feel WordOps has a lot more support behind it. Thank you for sharing this.

Leave a Reply