This directory contains scripts to handle the upgrade from PostgreSQL 9.6.x to 11.10. All of these scripts MUST be kept together in one directory for them to work. If the server to be upgraded is part of a streaming replication setup, see the NOTE FOR STREAMING REPLICATION SETUP at the end of this document. INSTRUCTIONS - COMPLETE THIS AFTER INSTALLING RPMS: All scripts must be run as root. 1. BEFORE starting PostgreSQL, run upgrade_postgresql_database.sh. Check the end of the output for "UPGRADE COMPLETE". Do not interrupt the script while it is running, as this may prevent proper cleanup. This string will appear only if the upgrade was successful. 2. Run rebuild_stats_and_hash_indexes.sh. This must be done while PostgreSQL is running. This script is separate from the previous step because it takes longer to run. It can/should be run while EDEX or other users of the database are running, to limit downtime. 3. If all previous steps have completed successfully and PostgreSQL is not producing errors, you can delete the old PostgreSQL install located at /awips2/postgresql-9.6.20_done NOTE FOR STREAMING REPLICATION SETUP: In a streaming replication setup where there is one master PostgreSQL server and multiple standby servers that replicate from it, the process is as follows: 1. Stop all PostgreSQL servers in the topology. 2. Upgrade the master using the above instructions. 3. Start up the master PostgreSQL server. 4. Re-create each standby server by following the directions in /awips2/database/replication/README, under the section SETTING UP STANDBYS.