At Crowd we ship a lot of websites and even more code. Our deployment processes is tried and tested, relatively efficient, and can be broken into 3 chunks.
We also have an in-depth Flywheel deployment guide.
Step 1: Grab a copy of the site and database
Whether the deployment is dev -> live, local -> dev, or even live > local; the first step is always the same.
- Grab a dump of the database. We quite like using Sequel Pro for this.
- Locate the entire contents of the root web directory for your server and download it to your local machine if it isn’t there already. This serves as a backup of the system as well as providing means for a deployment.
Pro tip: For legacy websites, and some themes it’s often prudent to search the downloaded files for the old site’s URL and replace it with the new one.
Step 2: Provision an environment
This might be a live environment or a development environment, but the process is the same in broad strokes.
- Create a new site with one of our providers. This will either be TSO or Flywheel — AWS environments are more bespoke.
- Enable SSH if it isn’t already and put your public key in the appropriate location.
- Create a MySQL database if there isn’t one present (using a 32 character secure and random password) and keep a record of the details to hand.
- Input these database details into your local copy of
- Upload all of the files you downloaded earlier. Pro Tip: rsync is a faster way of doing this if you’re comfortable with terminal.
- While the site is uploading, connect to the new database and import the dump you created earlier.
- Download a copy of Search and Replace DB and upload it to the server.
- Visit the directory and run a search and replace that replaces the website’s old URL with the new URL.
- Remove the Search and Replace tool from the server.
Step 3: Testing and DNS
Whenever we deploy to an environment (even a development environment) we test that the deployment has been successful. A quick list of things we check for would include:
- Can visit the front end of the site without errors
- Can access CMS without errors
- Can upload media without errors
- Can publish a post without errors
- Forms work correctly and go to the right place.
- Any analytics/tracking services are in place.
- Google maps and other licensed APIs load without errors
In environments that don’t have domains pointed to them (usually just prior to go-live) we add an entry to our Hosts file so we can test the website before it goes live.
Provided the testing is successful we change the DNS ourselves or notify the client that the site is ready, along with the DNS records they need to change.