0

I have a number of issues in a PostgreSQL 11 database.

  1. I'm very close to filling the 2TB data drive but I'm not able to "grow" the drive
  2. I'm finding it very difficult to reduce the size of the database by removing old data from the two very large tables and retain only the most recent three years' worth of readings data. I'm not able to use table partitioning on these two tables as they have foreign keys
  3. I want to upgrade to v14 or v15

My current plan is to replicate the data to a new, larger, second drive to buy myself time, and then switch to that drive when I'm all up-to-date.

Elsewhere, I've been told the way to go is...

  • Stop the cluster
  • Move the entire top-level directory to another drive
  • Update the data_directory in postgresql.conf
  • Restart the cluster

I was hoping there'd be a way to effectively run a "live" backup to this new drive, stop the service when up-to-date, point the service to the new drive and off we go. I can hold-off the incoming data but down-time needs to be less than 3 hours. I think copying nearly 2TB of data will exceed this time limit.

Once I'm switched to the new drive, it's my understanding I could then carry out the upgrade in-place with far less down-time.

So my question then is what configuration changes do I need to apply to kick-off the replication?

0 Answers0