Creating a staging environment and utilizing pagely sync

Last Updated -

In this article we'll discuss how to create your own custom staging site within your Pagely environment.

To accomplish the task ahead of us you'll need the following.

  1. A Pagely VPS account, logged in as either the account owner or a collaborator with proper permissions (collaborators lower than tech level won't be able to accomplish the steps discussed in this article).
  2. An ssh user, with an ssh public key deployed to your Pagely VPS
  3. Putty, or an OSX/Linux terminal. (The private key associated with the public key should also reside on the computer you are using the putty/terminal app.

To start, log in at, click on sites > all sites...


once there, click on the "Add New" button


Add the Primary domain, or subdomain. In this case, we're going to use 'staging' as our subdomain, prefixing the production name of the application we want to clone to our staging site. For example...

our production site -->

Our staging site -->


NOTE: We are not going to use the advanced features, as cloning multisite applications requires a level of complexity that will most likely require additional assistance from support.

Once you hit Save & create we'll wait for the new application to deploy...


After a while hit refresh and you should see the following...


At this point you have several options. All Pagely applications have a generic url that will load the application in your browser. Most people are fine with this as it requires no further DNS configurations. However, if your intention is to test Pagely caching mechanism, or other production scenarios, you'll need to host your custom domain name. That is discussed in switch primary domain names article, and pointing traffic to pagely article.

We can now proceed to ssh into our Pagely VPS, and get to work.

From Putty or terminal, enter the following command


If you're the account owner, all your client_usernames can be found at > My Account > Collaborator access...



If you're a collaborator, your client_username can be found at > My Account > SSH Configuration...



Once logged in, you can run the following command to see what sites you have access to...

ls ~/sites

we should see our production and staging site.


Now we can utilize the Pagely sync command. Since we are cloning production to staging we will run the following...

pagely sync ~/sites/ ~/sites/ --rename

the --rename flag at the end attempts to change the old primary domain from production, with the new primary domain on staging. To be safe, we'll make sure this is successful with wp search replace...

run the following commands...

cd ~/sites/
wp search-replace http://oldsitename http://newsitename

we also want to clear cache to be safe...

wp cache flush

be sure to clear browser cache as well.

After this, a duplicate of your site should appear under the primary staging url


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.

Powered by Zendesk