Fastest non-intrusive way I know in RDS or any other environment which allows you to spin up a new box:
* Set up a replica (physical replication)
* Open a logical replication slot for all tables on your old master (WAL will start accumulating)
* Make your replica a master
* Upgrade your new master using pg_upgrade, run analyze
* On your new master subscribe to the logical replication slot from your old master using the slot you created earlier, logical replication will now replicate all changes that occurred since you created the slot
* Take down your app, disable logical replication, switch to the new master
You can do the upgrade with zero downtime using Bucardo Multi-Master replication but the effort required is much much higher and I'm not sure if this is really feasible for a big instance.
* Set up a replica (physical replication)
* Open a logical replication slot for all tables on your old master (WAL will start accumulating)
* Make your replica a master
* Upgrade your new master using pg_upgrade, run analyze
* On your new master subscribe to the logical replication slot from your old master using the slot you created earlier, logical replication will now replicate all changes that occurred since you created the slot
* Take down your app, disable logical replication, switch to the new master
You can do the upgrade with zero downtime using Bucardo Multi-Master replication but the effort required is much much higher and I'm not sure if this is really feasible for a big instance.