Deployment: best practices
(no mark for that in the practical assessment, just for your culture)
The non-professional way (version 1)
Solution
- Install WordPress using your hosting provider automated install
- Change settings
- Edit themes, plugins and pages from the administration interface
The non-professional way (version 1)
Problems
- No control over the files
- No recovery from a crash
- A single environment for development, tests and production
The non-professional way (version 2)
Solution
- Install and work on your project locally
- Find the edited files and send through FTP/SFTP/SSH...
- Check if the site work or update configuration accordingly
The non-professional way (version 2)
Problems
- What files did you change?
- Do not override the server configuration with your local one
- Do not override your files with updates or updates with outdated files
The semi-professional way
Solution
- Work locally
- Commit and push your files to a distant repository
- Connect to your server with ssh and pull your files
You can also use branches and tags on GIT to create different environments.
The semi-professional way
Problems
- Something happens on the server, visitors can be there at the wrong time
The ultimate way
Solution
- Use continuous integration / continuous delivery
- Generate an artefact (an archive of the production files)
- Provision a server and deploy
- Run acceptance tests
- Move the link from the old server to the new one (also works with folders and symlinks)
Database
The hardest part in moving a CMS.