R
Railway•8mo ago
kiryl_ch

how to restore postgres db from dumb?

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 pg_restore -U <username> -h <host> -p <port> -W -F t -d <db_name> <dump_file_name> but I am getting error pg_restore: error: could not find header for file "toc.dat" in tar archive
Solution:
asked someone else on the team who was involved, this should be the command you need
psql $url_to_restore_to -f file.sql
psql $url_to_restore_to -f file.sql
...
Jump to solution
27 Replies
Percy
Percy•8mo ago
Project ID: N/A
Brody
Brody•8mo ago
when you where given your archive file, where you given a command to run to restore it?
kiryl_ch
kiryl_ch•8mo ago
no
Brody
Brody•8mo ago
please ask them for the correct command needed to restore the database
kiryl_ch
kiryl_ch•8mo ago
they closed the thread 😉
Brody
Brody•8mo ago
fair enough
kiryl_ch
kiryl_ch•8mo ago
i fill like i am missing something
Brody
Brody•8mo 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 do you remember who you talked to?
kiryl_ch
kiryl_ch•8mo ago
Christian Ohrgaard
Brody
Brody•8mo ago
I assume you where emailed the file?
kiryl_ch
kiryl_ch•8mo ago
yes, i was provided with links in support thread
Brody
Brody•8mo 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?
kiryl_ch
kiryl_ch•8mo ago
.tar.gz
Brody
Brody•8mo ago
have you tried restore commands that are compatible with tarballs?
kiryl_ch
kiryl_ch•8mo ago
inside two files postgres.sql and railway.sql i thought the one i am using is compatible:)
Brody
Brody•8mo ago
seems it's not
Solution
Brody
Brody•8mo 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
psql $url_to_restore_to -f file.sql
kiryl_ch
kiryl_ch•8mo 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 "_timescaledb_catalog.chunk_id_seq" does not exist
Brody
Brody•8mo ago
did you use timescale features of your legacy database?
kiryl_ch
kiryl_ch•8mo ago
i do not know
Brody
Brody•8mo ago
is this not your app?
kiryl_ch
kiryl_ch•8mo ago
it is mine, but i never heard about timescale
Brody
Brody•8mo ago
then you definitely didn't use it so check to see if all your data is there
kiryl_ch
kiryl_ch•8mo ago
this database was used as db for strapi cms, if it makes sence
Brody
Brody•8mo ago
yep I know about strapi, it would not have used timescale features
kiryl_ch
kiryl_ch•8mo ago
looks like it is working, strapi running without problems on restored db. thank you for your help
Brody
Brody•8mo ago
awesome!
Want results from more Discord servers?
Add your server