Aravind
Aravind

Reputation: 1

Postrgesql base Backup - older version to New version

Can we take base backup from postgresql old version db to new version db.

For Example I have two DB servers. One server is having old version Postgres 9.x and another one is running Postgres 13.  

If I want to take base backup from postgres 9.x for Postgres 13, can we do that directly using the pg_basebackup command in Postgres 13 DB server.

Is there any other way to complete the above task in Postgres.

I have a plan below to complete the above task if the base backup does not work for lower to higher versions. But it is a slow process.

DB A has a lower version and DB B has a higher version.

So to take base backup, updating the A DB version same as B DB is the only option.  Once the DB A updated successfully, Then start the base backup from A DB with updated Postgres version to the B DB. 

We can refer to the below site for the DB update process.

https://www.migops.com/blog/upgrading-postgresql-9-6-to-postgresql-13/

The DB update process will take time to complete. In that time the write process will not work on the primary DB.  All the write process will be affected because of this.  If any issue happens in the update process, almost everything will be a mess. 

I will suggest the old version DB to the new version db base backup process  to complete this activity.

Do you guys have any suggestions?

Upvotes: 0

Views: 1245

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 248175

You are mixing up physical file-system level backup (pg_basebackup) and logical backup, also known as dump or export (pg_dump). You can only use the latter for upgrading. A pg_basebackup can only be restored to the same major PostgreSQL version.

Upvotes: 2

Related Questions