Subject to change after runs in staging
- Install new postgres version in separate directory structure
- Ensure
pg_upgradeis installed for 9.3 and 9.4 - Copy 9.3 conf files to 9.4 directories.
- Dump database using
pg_dump(just in case) - Shutdown application (app, worker, label, all). Ensure maintenance is up.
- Shutdown old version (IS THIS RIGHT? OR DO BOTH HAVE TO RUN ON DIFFERENT PORTS?)
- Use
pg_upgradeto migrate data from 9.3 to 9.4 - Verify data/operability
- Change init scripts to run 9.4 binaries
- Change user's
PATHto include 9.4 binaries - Bring up new version (IS THIS RIGHT? OR HAVE THEY HAD TO REMAIN RUNNING?)
- Test connection and queries from app server with
console - Bring up app servers (app, worker, label, all)
- Verify app works.
- Bring down maintenance page.
Subject to change after runs in staging
- Ensure init scripts run 9.3 binaries
- Ensure user's
PATHto include 9.3 binaries - Bring up old version (IS THIS RIGHT? OR HAVE THEY HAD TO REMAIN RUNNING?)
- Test connection and queries from app server with
console - Bring up app servers (app, worker, label, all) and verify app works
- Bring down maintenance page.
- Remove 9.3 packages
- Remove 9.3 data files
- Discussion: Database backups are managed by Rackspace using Holland. Would this still work after this upgrade? Yes, but we need to make sure the daemon will see the correct binaries, this requires us to modify their path and/or to redirect symlinks in /usr/bin to new binaries.
- Answer question: Do we need to install packages and/or reinstall
pggem on app servers? Does not appear so in staging. - Answer question: Do both servers have to be running on different ports during this process? Both servers should be shut down during this process. pg_upgrade will run
postgresbinary for each version and will abort if either server is running against their data dirs. - Answer question: How do we install 9.4? Are there packages available (and will they not overwrite 9.3)? Or do we need to compile on server? I have compiled and installed in staging and it was not a difficult process and allowed me to control everything to ensure we were not overwriting anything related to 9.3 (so we could abort)
- Answer question: What do we need to do to the hot slave? Can we do the same thing there, or will it need to be wiped?
- Verify assumption: Postgres 9.4 can work with our prod 9.3 configuration files. Nothing in stagings pg_hba.conf or postgres.conf files was version specific, and 9.4 is running in staging with the 9.3 config files. There were some optional new config options in the 9.4 config files that were commented out.
- Answer question: Can 9.3 data files be deleted safely? Yes, pg_upgrade should be done with the hard links option, to make it very fast, and not increase the disk size. Need to make sure we can reverse the process, though...
- Carry out upgrade on staging, automate what I can and note what I cannot. Note time to upgrade data on staging.
- Extrapolate time to upgrade staging to time to upgrade production. < 20 minutes if we can use the hard linking option of pg_upgrade
- After upgrading data with pg_upgrade and its hard-link option, can we still use the old postgres version if we need to abort for some reason?
- Carry out abortion on staging and ensure works, no hiccups.
- Postgres release notes (all versions)
- Man page for pg_upgrade (9.4)
- Postgres docs on upgrading to 9.4 (via slow psql)
- Migration from 9.3 to 9.4 in Puppet Env
- Migration Issues #1
TBW after carrying out in staging.