Creating a Staging Environment

Last Updated -


Using a staging environment is critical to the stability of your site. By testing your site on a staging environment before making it live in production, you can easily identify potential issues without impacting existing users.

In this article, we'll show you how to create a staging site and use the Pagely Sync tool to clone your current production site over to your new staging environment.

Creating a Staging Site

Creating a new site inside the Atomic control panel is easy. Here’s how to do it:

  1. Log into your Atomic control panel.
  2. On the left side main menu, click on Apps.
  3. At the top right of the Apps page, click on the New App button.
  4. Fill in the Primary Domain field with the domain you’ll want to use. Typically, this is something like staging.example.com.
  5. Finally, click the Save and Create button to create your new staging site.

create-staging-site.png

Your staging site is now created and ready to use. Since it’s a freshly created app, you’ll still need to add your own content to it. Follow along in the next section to learn how to clone your existing production site over to your new staging environment.

Cloning from Production to Staging

Now that you’ve created a staging environment, it’s time to clone over a copy of your site to it.

  1. Begin by logging into your VPS via SSH. If you need more information on accessing your VPS over SSH, see our article on using SSH at Pagely.
  2. To clone your production site over to your staging environment, you can use the Pagely Sync tool like this:
    pagely sync --rename ~/sites/example.com ~/sites/staging.example.com
  3. In case you have references to your production domain still inside your staging database, you can run a search and replace using WP-CLI. Jump over to your staging site’s location on the server by running the following:
    cd ~/sites/staging.example.com
  4. Next, run a search and replace with WP-CLI using the following command:
    wp search-replace http://example.com http://staging.example.com
  5. While we’re here, let’s go ahead and flush the cache too:
    wp cache flush

If everything ran successfully, a copy of your files and database should now exist within the staging environment. From here, you can perform changes to your new staging site without impacting your production site.

Next Steps

Depending on your site, you might also need to make additional changes to your staging site after cloning it. Every site is going to be different, but here's a few things to look for:

  • Automated payments such as subscription renewals, invoicing, etc.
  • Automated emails.
  • Anything else that you would only want to run live in a production environment.

If you want to configure a more robust cloning system by creating a custom profile, take a look at the more advanced Pagely Clone Tool.

Related Topics

Pagely is the Managed WordPress Hosting Platform designed to exceed the needs of media, business, and Enterprise customers alike. We help the world's biggest brands scale WordPress.

Copyright © 2006-2017 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Pagely
Powered by Zendesk