multibit-merchant
multibit-merchant copied to clipboard
Database upgrade and rollback process
Require a mechanism to allow the local database to be patched and populated safely.
The following approach could be used (includes client UI and platform operations):
- MH From the admin screen user clicks the Upgrade button
- CH All active user sessions are sent an alert giving them 1 minute before forced log out
- CH New users arriving are shown a system maintenance screen
- MH All active users sessions are suspended, and no new ones permitted.
- MH Database is backed up to {currentVersion}-final-snapshot.zip
- MH Admin is given message that upgrade preparation is complete
- CH Call out to script to perform shutdown and launch upgrade
- MH On startup new version uses existing database as basis for upgrade
- MH The version table contains the previous version and is used as the basis for applying a sequence of one-way patches to reach the current version
- MH If a patch fails at all, the upgrade fails and a rollback procedure is started (see later)
- MH Admin is given message that upgrade is complete
- MH Customers are accepted back on to the system
For rollback the following process could be used (includes client UI and platform operations):
- MH From the admin screen user clicks the Rollback button. Only available if an upgrade has failed.
- MH Existing database is backed up to {currentVersion}-failed-upgrade.zip to allow for more sophisticated recovery operations if necessary
- MH Existing database removed and restored from most recent of {previousVersion}-final-snapshot.zip
- MH Admin is given message that rollback preparation is complete
- CH Call out to script to perform shutdown and launch previous version