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 atomic.pagely.com, click on sites > all sites...

Screen_Shot_2017-09-18_at_1.59.11_PM.png

once there, click on the "Add New" button

Screen_Shot_2017-09-18_at_2.01.37_PM.png

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 --> pagely.customers.info

Our staging site --> staging.pagely.customers.info

Screen_Shot_2017-09-18_at_10.39.44_AM.png

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

Screen_Shot_2017-09-18_at_2.11.36_PM.png

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

Screen_Shot_2017-09-18_at_2.13.05_PM.png

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

ssh client_username@yourvpsname.pagelyhosting.com

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

Screen_Shot_2017-09-18_at_2.21.39_PM.png

Screen_Shot_2017-09-18_at_2.26.36_PM.png

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

Screen_Shot_2017-09-18_at_2.22.34_PM.png

Screen_Shot_2017-09-18_at_2.29.05_PM.png

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.

Screen_Shot_2017-09-18_at_4.14.47_PM.png

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

pagely sync ~/sites/pagely.customers.info ~/sites/staging.pagely.customers.info --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/staging.pagely.customers.info
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.

Pagely
Powered by Zendesk