0

I've followed the excellent guide here to upgrade from 9.6.2 to 10.5 on mac os 10.11.6. When I get to the step 6

pg_upgrade -b /usr/local/Cellar/postgresql/9.6.2/bin/ \
-B /usr/local/Cellar/postgresql/10.5/bin/ \
-d /usr/local/Cellar/postgres.old/ \
-D /usr/local/Cellar/postgres.new/

I get this error

check for "/usr/local/Cellar/postgresql/9.6.2/bin" failed: No such file or directory

even though mv /usr/local/Cellar/postgresql/9.6.2 /usr/local/Cellar/postgres.old ran ok.

However when I go to

/usr/local/Cellar/postgresql/9.6.2/bin/: No such file or directory

Looking at

$ du -sh /usr/local/var/*/
148K    /usr/local/var/homebrew/
917M    /usr/local/var/log/
202G    /usr/local/var/postgres96/
37M /usr/local/var/postgresql@9.6/

I think my data is still there (postgres96) but don't understand how to get to it and finish pg_upgrade. Any help gratefully appreciated

EDIT;

I think i need to run something like the below to undo the error i made;

undo the move

mv /usr/local/Cellar/postgres.old /usr/local/Cellar/postgresql/9.6.2

Check that worked running

ls /usr/local/Cellar/post*

I should see a bin in the 9.6.2 direcotry and then i can initialize a new cluster data dir:

initdb /usr/local/var/postgres.new

then

pg_upgrade -b /usr/local/Cellar/postgresql/9.6.2/bin/ \
-B /usr/local/Cellar/postgresql/10.5/bin/ \
-d /usr/local/var/postgres96/ \
-D /usr/local/var/postgres.new/

Is that correct?

Given I've backed up with pg_dump

Community
  • 1
  • 1
mapping dom
  • 1,737
  • 4
  • 27
  • 50
  • If you renamed postgresql to postgres.old postgresql/bin is now postgres.old/bin. HTH :-) – kometen Nov 10 '18 at 07:51
  • The error says that path doesn’t exist. And if you say you moved the files away from there that’s probably the reason. Why are you telling it to use nonexistent paths on the command line? – Sami Kuhmonen Nov 10 '18 at 07:51
  • @kometen Thanks for the hint but it doesn't think that's there either `check for "/usr/local/Cellar/postgresql.old/bin" failed: No such file or directory ` – mapping dom Nov 10 '18 at 07:58
  • @SamiKuhmonen those are the steps listed on that blog, I'm not familiar with the command line – mapping dom Nov 10 '18 at 08:00
  • @mappingdom What folders do you see if you issue a 'ls /usr/local/Cellar/post*'? – kometen Nov 10 '18 at 09:08
  • @kometen thanks i see `/usr/local/Cellar/postgres.old: COPYRIGHT README include HISTORY bin lib INSTALL_RECEIPT.json homebrew.mxcl.postgresql.plist share` but swapping that into pg_upgrade still get `could not open version file: /usr/local/Cellar/postgres.old/PG_VERSION ` – mapping dom Nov 10 '18 at 09:47
  • @mappingdom Did you mistakenly rename the folder in /usr/local/Cellar rather than /usr/local/var? The guide only rename (mv) /usr/local/var. – kometen Nov 10 '18 at 10:33
  • @kometen i've edited the original Q with what i think i now need to run – will i need 202gb free on the drive to run this given thats the size of existing postgres96 ordoes it just rename/replace links – mapping dom Nov 10 '18 at 12:09

0 Answers0