Deployment Guidelines Documentation

Notes

  • FTP is used here as a stand-in to also indicate that copying files over remote desktop would accomplish the same goal
  • The Emergency Plan is enacted when the Contingency plan fails and/or the backup made previously is corrupted

Method A - Direct FTP copy to Web Folder

Risk Assessment

Method A is used primarily for pushing content to a staging environment where downtime is not a concern and having a backup of the previously deployed code is not a requirement. This method is the most risky and is also the fastest but however should be avoided completely on high profile sites. This method can also generate downtime while files are slowly copied over FTP to the target WWW location during which some files are updated and others remain outdated.

Average Downtime: 10s - 3m :: Backup Downtime: ~10s - 30s

Steps

  1. Create a complete copy of the target WWW folder
  2. Create a database backup
  3. Compile source project using publish function
  4. Using FTP directly copy files to target WWW folder
  5. Verify application functionality

Contingency Plan

  1. Restore database backup
  2. Copy complete file backup to target WWW folder

Emergency Plan

  1. Check out previously known working copy of project
  2. Start at step 3 of method A

Pros

  1. Not a lot of steps so the instructions are simple

Cons

  1. Interruption of connection can result in incomplete deployment
  2. Failing to create backups before hand can result in disaster causing one to start from step 1 of method A Emergency Plan including all downtime therein
  3. FTP file copy direct to target WWW folder can be slow and result in intermittent access to the site during the deployment

Method B - Indirect FTP copy to Web Server

Risk Assessment

Slightly safer than Method A this method uses a temporary location where files are copied before moving the files into the target WWW folder. This reduces downtime produced by a slow or incomplete FTP transfer. This method does however carry the risk of a bad merge of files that would then require the backup files be restored including all visible downtime this produced.

Average Downtime: ~10s - 30s :: Backup Downtime: ~10s - 30s

Steps

  1. Create a complete copy of the target WWW folder
  2. Create a database backup
  3. Compile source project using publish function
  4. Using FTP copy files to temporary folder on the target web server
  5. Copy files from temporary folder to the target WWW folder
  6. Verify application functionality

Contingency Plan

  1. Restore database backup
  2. Copy complete file backup to target WWW folder

Emergency Plan

  1. Check out previously known working copy of project
  2. Start at step 3 of method B

Pros

  1. Only minimally more difficult than method A
  2. Unlike method A the file copy between folders that already exist on the server will be tens to hundreds of times faster reducing visible downtime of the application to that of a few seconds

Cons

  1. Failing to create backups before hand can result in disaster causing one to start from step 1 of method A Emergency Plan including all downtime therein

Method C - Indirect FTP copy and WWW Repoint

Risk Assessment

Method C implements several checks during the process that can help avoid a potentially disastrous situation. Using a temporary folder copy of the target WWW folder we can perform the merge of code and settings and view this by a secondary url setup on the production server. Using directory mapping we simply point the production site at the temporary folder to verify its working as expected then move those files to the actual target WWW folder. This method carries with it the least amount of risk but is the most lengthy in execution.

Average Downtime: ~1s - 10s :: Backup Downtime: ~1s - 10s

Steps

  1. Create two complete copies of the target WWW folder, one for backup, the other for merging
  2. Create a database backup
  3. Compile source project using publish function
  4. Using FTP copy files to merging folder on the target web server
  5. Point the source location of the merging site to merging folder
  6. Verify merging application functionality
  7. Point the source location of the production site to merging folder
  8. Verify application functionality
  9. Copy files from merging folder to original target WWW folder
  10. Repoint the source location of the production site to the target WWW folder
  11. Verify application functionality

Contingency Plan

  1. Restore database backup
  2. Point the source location of the production site to backup folder
  3. Copy files from the backup location to the target WWW folder
  4. Repoint the source location of the production site to the target WWW folder

Emergency Plan

  1. Check out previously known working copy of project
  2. Start at step 3 of method C

Pros

  1. Instantaneous switching of newly updated code and original code using repoint method
  2. Allows one to to check merged code via a secondary url on the deployment server

Cons

  1. Somewhat lengthy process that should be performed by an server admin or professional
  2. Does require additional DNS be setup ideally under the same domain to view merged code

Method D - Web Deploy

Risk Assessment

Generally this would be the most preferable method with the least amount of risk of something going wrong during the deploy.

Average Downtime: ~10s - 30s :: Backup Downtime: ~10s - 30s

Steps

  1. Create a complete copy of the target WWW folder
  2. Create a database backup
  3. Using publish dialog set the properties appropriately and select Publish
  4. Verify application functionality

Contingency Plan

  1. Restore database backup
  2. Copy complete file backup to target WWW folder

Emergency Plan

  1. Check out previously known working copy of project
  2. Start at step 3 of method D

Pros

  1. In a best case scenario using build scripts and the deployment package one should not need to log-in to the server over remote desktop.
  2. Fast deployment of files with only necessary changes being deployed if the appropriate options are selected

Cons

  1. Requires advanced setup before files can be pushed using this method and may not be practical for all sites

Deployment Guidelines was created by Travis Brown, email: WarriorRocker@gmail.com.