Here is an overview of the steps required to place a website copy from development environment into production. Use this information if you have a production version of your website and a new one located elsewhere at the moment, and you want to upgrade your production site with the new version.
The idea is to copy your development site to a staging, check if everything works fine, and then put this version into production.
- 1. Create a staging site.
Staging website is a website used to test and review its newer version before it is moved into production. For the best result, a staging site should be in the same subscription where your production site is hosted. If your development copy is in the same subscription, skip this step. Otherwise, create a staging site:
- Go to your production subscription.
- Create a domain or subdomain for the new staging site. Do not register a staging domain name if you do not want your staging site being accessible from the Internet.
- If your development site has an APS application installed, install this application on your staging site.
- Copy the site files from the development environment to staging:
- If the development site is hosted on the same server and is accessible from your account, use the "Website Copying" function.
- If the development site is located elsewhere, make sure that your staging site has proper FTP access setup, and use FTP protocol to carry over the site files.
- 2. Prepare a database.
If you updated the site database during development and are going to use it with your new site, the updated database should be in your production subscription. If it is already there, skip this step. If the updated database is not in the production subscription yet, copy it to a new staging database:
If you are going to use the current production database with your new site:
- Create a new database in your production subscription.
- Copy the updated database from your development environment to the staging:
- If your development environment is managed by Panel 11.x, go to the development subscription, then Websites & Domains tab > Databases, click the database name, and then "Make a Copy".
- If it is managed differently, use the mysqldump utility to create a dump and then to restore it into your staging instance.
- Update scripts on the staging site to connect to the just created database.
- Turn the maintenance mode on for the production site.
- Change the scripts on the production site so that they do not connect to the database any more.
- Run database upgrade scripts if needed.
- Update scripts on the staging site to connect to the production database.
- 3. Adjust APS applications.
If your development site has an APS application installed, it is recommended to have the same application pre-installed on your staging site before you start copying files and database (this was mentioned at Step 1). Then deal with the application database:
- If you are going to use the new database for production:
- Copy the application database from your development environment into staging.
- On your staging site, go to the Installed Applications list (at Applications tab), open the application Settings screen and resave the parameters. This will force the scripts that were just copied to reconnect to the staging database.
- If you are going to reuse the production database, update the database connection settings for the application on the staging site to connect to the production database.
- 4. Verify results.
Verify that the staging site works correctly.
- 5. Publish the updated site.
Change the document root of your production site:
- In the domain list of your production subscription, click the production site URL.
- In the "Document root" field, enter the same directory used as a document root by the staging website. Save the site settings.
- 6. Make the site available.
If your production site was put into maintenance mode, resume normal site operation.