A safe development workflow: local, staging, live
Changing a live site directly is risky. A simple three-stage routine keeps mistakes away from customers.
The three stages
| Stage | Where | Who sees it | Purpose |
|---|---|---|---|
| Local | Your computer | You | Write and break things |
| Staging | staging.example.ca on Barbrick |
You and reviewers | Test on the real server setup |
| Live | example.ca |
Customers | The real site |
Staging comes with Business and Pro. On Essential, use a subdomain and copy files by hand. See Staging sites.
1. Local
- Run the site on your computer with Docker, Local, MAMP, or your language's dev server.
- Put the code in Git. Add
.gitignorefor secrets and large folders. - Match PHP, Node, or Python versions to the server. See Change PHP version and extensions.
- Keep secrets in
.env, not in code. See Set environment variables for apps.
2. Staging
- Create a subdomain. See Create a subdomain.
- Protect it. See Password-protect a folder.
- Deploy the Git branch
staginghere. See Deploy with Git. - For WordPress, use the staging copy in the WordPress section instead. See Stage or clone a WordPress site.
- Turn off real payments and emails.
- Test the changes. Send the staging address to your reviewer.
3. Live
- Take a backup. Daily backups run, but take a fresh one before a release. See Back up and restore WordPress and Export a database.
- Merge to
main. - Deploy. See Automatic deployment from Git.
- Clear caches.
- Check the site and error log. See Read your site's error log.
Database changes
Code goes forward through Git. Data usually doesn't. Don't copy a staging database over live if customers have placed orders. Instead:
- Run migrations in code, or
- Replay the content edits by hand, or
- Sync files only. See Stage or clone a WordPress site.
Release checklist
[ ] Tested on staging
[ ] Backup taken, and I know how to restore
[ ] Deploy at a quiet time
[ ] Key pages and forms checked after deploy
[ ] Error log clear
[ ] Cache purged
[ ] Rollback plan: git revert, or restore backup
Roll back
git revert HEAD # undo the last commit, then redeploy
Or restore from Backups in your account. We keep 30 daily restore points.
Still stuck? Ask us and we'll walk you through it.