1

I have docker container with postgres 12 and I want to upgrade it to 13. This image stores data and configs in /var/lib/postgresql/data dir:

  1. show data_directory; returns that directory
  2. postgresql.conf is stored in that directory

I tried to execute pg_upgrade with that directory (in old pg12 volume) as old data and config directory argument: docker run --name migrate13 -v pg12_volume postgres:13 su postgres -c "cd /tmp && pg_upgrade -b /var/lib/postgresql/data -d /var/lib/postgresql/data -B /var/lib/postgresql/data13 -D /var/lib/postgresql/data13"

Error check for "/var/lib/postgresql/data/postgres" failed: No such file or directory is returned. I failed to find what this error means: I provided wrong data or config directory?

What right directories should contain and how to find them?

2
  • usually you create a new containment or use a already created one?
    – djdomi
    Mar 8, 2022 at 18:47
  • I never migrated this db before. So usually I do nothing. Now I want to create new pg13 container with old volume with existing shemes and data Mar 9, 2022 at 8:55

0

You must log in to answer this question.

Browse other questions tagged .