create script for PostgreSQL upgrade
we need to script all the steps the database migration ( could be in ansible):
- consider that all the steps will be executed one-by-one and we can cancel the total execution in case of any failure
- would execute them from a bastion in a shared session as screen
- the steps will be :
** Pre checks : **
- Verify files ownership
- Check Version before the upgrade
- Verify check of pg_upgrade
- Delete and verify the monitoring functions are deleted.
- Verify the collation between versions.
** Upgrade steps : ( migration script) **
- stop all the connections and verify that
- stop the 9.6 cluster
- Take a snapshot from the database.
- Execute pg_upgrade ( all nodes )
- Apply pg configuration changes ( parallel query parameters ( parallel ) and others… autovacuum maybe ) ( all the nodes ) ( MR to executed separated )
- Start cluster
- Vacuumdb analyze ( primary )
- Vacummdb freeze ( primary) - it will run for longer … we will start with QA tests and enabling traffic. Changes on PG_exporter ( all nodes )
** Post checks : ( migration script) **
- Check version after upgrade
- Create views and functions taht we need for monitoring and verify they are created properly
- Change some functions for monitoring in exporter
Edited by Jose Finotto