Score:1

Which directories to provide for pg_upgrade?

cn flag

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?

djdomi avatar
za flag
usually you create a new containment or use a already created one?
Alexey Kholodkov avatar
cn flag
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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.