问题
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
来源:https://stackoverflow.com/questions/53237011/pg-upgrade-with-brew-mac-os-9-6-2-10-5