Challenges moving databases
Life of a VPS server is limited. Operating systems and Postgresql databases get old and outdated. And there are sure many other reasons for moving a database to another server. Here are some challenges.
Challenge #1: Different versions of Debian.
Although Debian has a long supported life, it does not last forever. Upgrading from an old Debian to the latest version, may be risky - or even impossible. So I decided to create a new fresh VPS with the latest Debian and move the databases instead.
Challenge #2: Different versions of Postgresql
Upgrading an old Postgresql database to a new version of Postgresql seems also to be risky. The pg_dump and pg_restore will be way simpler and a better choice.
Challenge #3: Moving many databases
Moving one or 2 databases, I should probably use pgAdmin built in pg_dump and pg_restore. But several hundreds of databases may be a challenge. So I decided to create a script using Go that automates this.
Challenge #4: Outdated and growing databases
Customer databases grow and maybe need more space and databases get outdated. By moving the databases to new servers, there is also a possibility to clean up in a controlled way.