how to restore postgres db from dumb?
da1z
HOBBYOP

2 years 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

brody
EMPLOYEE

2 years ago

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


da1z
HOBBYOP

2 years ago

no


brody
EMPLOYEE

2 years ago

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


da1z
HOBBYOP

2 years ago

they closed the thread 😉


brody
EMPLOYEE

2 years ago

fair enough


da1z
HOBBYOP

2 years ago

i fill like i am missing something


brody
EMPLOYEE

2 years 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


brody
EMPLOYEE

2 years ago

do you remember who you talked to?


da1z
HOBBYOP

2 years ago

Christian Ohrgaard


brody
EMPLOYEE

2 years ago

I assume you where emailed the file?


da1z
HOBBYOP

2 years ago

yes, i was provided with links


da1z
HOBBYOP

2 years ago

in support thread


brody
EMPLOYEE

2 years 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?


da1z
HOBBYOP

2 years ago

.tar.gz


brody
EMPLOYEE

2 years ago

have you tried restore commands that are compatible with tarballs?


da1z
HOBBYOP

2 years ago

inside two files postgres.sql and railway.sql


da1z
HOBBYOP

2 years ago

i thought the one i am using is compatible:)


brody
EMPLOYEE

2 years ago

seems it's not


brody
EMPLOYEE

2 years 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

da1z
HOBBYOP

2 years 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


brody
EMPLOYEE

2 years ago

did you use timescale features of your legacy database?


da1z
HOBBYOP

2 years ago

i do not know


brody
EMPLOYEE

2 years ago

is this not your app?


da1z
HOBBYOP

2 years ago

it is mine, but i never heard about timescale


brody
EMPLOYEE

2 years ago

then you definitely didn't use it


brody
EMPLOYEE

2 years ago

so check to see if all your data is there


da1z
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

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


da1z
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

awesome!


Loading...