This commit is contained in:
2021-12-12 23:23:36 +00:00
parent 1aa190465f
commit c9dbb15f87

View File

@@ -41,16 +41,34 @@ Manual restore steps
Ensure data folders exist, clear out attachments and backups is currently empty
windows
psql -U postgres --set ON_ERROR_STOP=on AyaNova < C:\temp\xfer\amsbackup\db-20211212195504569.backup
pg_restore -C -d postgres C:\temp\xfer\amsbackup\db-20211212195504569.backup
pg_restore -U postgres -C -c -d postgres C:\temp\xfer\amsbackup\db-20211212195504569.backup
Error on first attempt:
pg_restore: terminated by user
^C
C:\data\code\postgres_14\bin>pg_restore -U postgres -C -c -d postgres C:\temp\xfer\amsbackup\db-20211212195504569.backup
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 4649; 1262 16384 DATABASE AyaNova postgres
pg_restore: error: could not execute query: ERROR: invalid locale name: "C.UTF-8"
Command was: CREATE DATABASE "AyaNova" WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'C.UTF-8';
pg_restore: error: could not execute query: ERROR: database "AyaNova" does not exist
Command was: ALTER DATABASE "AyaNova" OWNER TO postgres;
pg_restore: error: reconnection failed: connection to server at "localhost" (::1), port 5432 failed: FATAL: database "AyaNova" does not exist
Linux -> windows error of some kind maybe?? Research that shit
Fix is to create dest db first as I already wrote in instructions but then restore to *that* db, don't make a new one so this is the command line in this scenario:
C:\data\code\postgres_14\bin>pg_restore -U postgres -c -d AyaNova C:\temp\xfer\amsbackup\db-20211212195504569.backup