Reasonably invasive schemamigration
moggers87 opened this issue · comments
Matt Molyneaux commented
Moving from our mixed "alias"/"inbox" naming scheme to just "inbox" is going to require us to shut down the website and mail server completely. Here's what I plan on doing:
- Display a "We'll be back shortly" message via Apache, disabling our WSGI app in the process
- Stop Postfix (our backup MX will accept our mail in the meantime)
- Wait for Salmon to finish dealing with email, then stop that too
- Backup data
- Pull in new models via git
- Upload migration and apply it
- Use the Django shell to make sure everything isn't completely broken
If it goes tits up:
- [ ] Nuke the database, restore the backup
- [ ] Roll back git to the commit before the model changes
Everything works as far as I can tell
Lastly, bring everything back up:
- Restart Salmon
- Restart Postfix
- Remove tempory page and re-enable WSGI app
Matt Molyneaux commented
I'm leaving this until tomorrow, still testing the migration here.
Matt Molyneaux commented
Done and done.