Moving a site from staging to live

by Shane Bonham | Last edited: 10/25/2016

Here are the steps to follow when you are ready to launch your site, and want to move it from a staging server to a live server. Note: all steps assume you are working in the document root (for example httpdocs/ on Plesk servers).

Prepare live server

  1. Create a media folder (give it the same name as on the staging server).

Copy Files

Copy over all files except:

  • monkcache folder or monkcache.db
  • your media folder
  • monkcms.php
  • monkcode.txt
  • monkinstall.php
  • .htaccess (this is a hidden file, so be sure your FTP client is set up view hidden files)
  • comeback.php
  • robots.txt

Update FTP settings

Once all files are copied over, edit the site's FTP settings (Admin > Site > FTP). Enter the new hostname, username, password, etc for the live server. Note that if DNS has not propagated , you may need to rely on a hostname on the same server that has already resolved, or on the IP address of the server.

Update Home Page Setting

You can now edit the site's "Home Page" setting to the new domain URL on the main site setting screen: Admin > Site.

Update media

To repopulate the media folder, go to the media manager (Media > Media) and click the "Add All" link in any row. This will add all media items to the FTP queue, and they will be sent to the live server in batches.

You can also do this via FTP by transferring from the old media folder to the new folder using a FTP client. We recommend this method if you are launching the site in the middle of the day to ensure a timely transfer.

Load Config

On the sites list screen (Admin > Site), click the "Load Config" link in the row of the site you are moving. This will transfer the configuration files to the live server. Note: you do not need to wait for media to transfer in order to complete this step.

Shut down staging site

As soon as everything is moved over, add the following lines to the .htaccess file on the staging server. This will forward all users and requests to the live location:

RedirectMatch 301 ^(.*)$ http://www.{live-domain.com}$1
RedirectMatch permanent ^(.*)$ http://www.{live-domain.com}$1

Obviously, {live-domain.com} should be replaced with the domain of the new live site.