...
- Prepare the new database:
- Set up your new PostgreSQL 12+ instance where the data will be migrated.
- Stop both databases:
- Make sure to stop both the old (PostgreSQL 11) and the new (PostgreSQL 12+) databases to avoid any conflicts during migration.
Access PostgreSQL:
Log in to your old PostgreSQL 11 database and run the following commands:
ALTER TABLE backup SET WITHOUT OIDS;
ALTER TABLE push_output_group SET WITHOUT OIDS;
- These commands ensure that tables containing OIDs are altered to be compatible with newer versions of PostgreSQL (tables no longer support OIDs in version 12+). No errors should occur when executing them.
Pre-check the upgrade:
Run the following command to check if your system is ready for the upgrade:
pg_upgrade --check
- This will confirm whether the upgrade can proceed without issues.
- Backup the old database:
- Make sure to create a full dump of your old database for safekeeping, using the
pg_dumpcommand.
- Make sure to create a full dump of your old database for safekeeping, using the
Migrate the data:
- After ensuring everything is in order, migrate your data from PostgreSQL 11 to 12+ using:
pg_upgrade
- After ensuring everything is in order, migrate your data from PostgreSQL 11 to 12+ using:
Upgrading PostgreSQL from Version 12 to
...
18
- Backup Your Old Database:
- Before starting the migration, create a full dump of your old PostgreSQL 12 database. This step ensures you have a backup in case anything goes wrong during the upgrade process.
Check Compatibility:
Ensure that both your old (PostgreSQL 12) and new (PostgreSQL 1618) databases are compatible for migration. You can do this by running the following command:
pg_upgrade --check
- This command will verify that the upgrade can proceed without any issues.
Migrate the Data:
- Once you have confirmed compatibility, you can proceed with the migration using:
pg_upgrade
- Once you have confirmed compatibility, you can proceed with the migration using:
...