how to restore postgres db from dumb?

da1zHOBBY

a year ago

i was given my db archives because my db was deleted due to migration. I am trying to restore the db data by running this command pgrestore -U -h -p -W -F t -d but I am getting error pgrestore: error: could not find header for file "toc.dat" in tar archive

0 Replies

a year ago

when you where given your archive file, where you given a command to run to restore it?


da1zHOBBY

a year ago

no


a year ago

please ask them for the correct command needed to restore the database


da1zHOBBY

a year ago

they closed the thread 😉


a year ago

fair enough


da1zHOBBY

a year ago

i fill like i am missing something


a year ago

I am missing something too, I don't know what command their automated process ran to create that dump, so I would only be guessing at the command needed to restore it


a year ago

do you remember who you talked to?


da1zHOBBY

a year ago

Christian Ohrgaard


a year ago

I assume you where emailed the file?


da1zHOBBY

a year ago

yes, i was provided with links


da1zHOBBY

a year ago

in support thread


a year ago

okay, so the person who was responsible for creating the dumps is on DND right now so I'm not going to ask them, until they are off DND, keep trying to restore the dump file with different formatted commands. what file extension was your dump file provided with?


da1zHOBBY

a year ago

.tar.gz


a year ago

have you tried restore commands that are compatible with tarballs?


da1zHOBBY

a year ago

inside two files postgres.sql and railway.sql


da1zHOBBY

a year ago

i thought the one i am using is compatible:)


a year ago

seems it's not


a year ago

asked someone else on the team who was involved, this should be the command you need

psql $url_to_restore_to -f file.sql

da1zHOBBY

a year ago

thanks it seems to have done something, and i see some data created in db but during execution it threw me a banch of error like: psql:/railway.sql:1952: ERROR: relation "timescaledbcatalog.chunkidseq" does not exist


a year ago

did you use timescale features of your legacy database?


da1zHOBBY

a year ago

i do not know


a year ago

is this not your app?


da1zHOBBY

a year ago

it is mine, but i never heard about timescale


a year ago

then you definitely didn't use it


a year ago

so check to see if all your data is there


da1zHOBBY

a year ago

this database was used as db for strapi cms, if it makes sence


a year ago

yep I know about strapi, it would not have used timescale features


da1zHOBBY

a year ago

looks like it is working, strapi running without problems on restored db. thank you for your help


a year ago

awesome!