Import dump file containing a database dump to dbeaver
Asked Answered
B

2

5

I have a database dump in thisdb_2022.dump binary file that I'm trying to import to dbeaver, but I haven't found a way to import the database so I can see it.

I found the below in the dbeaver forum but when I try to follow the instructions and create a new connection I don't see any option I can select that will open this document.

https://dbeaver.io/forum/viewtopic.php?f=2&t=895

Edit: The database and version is PostgreSQL 12 . I'm not trying to dump it to an existing db rather I want to create a new one with this dump. the dump command looks like this: pg_dump -h blah.amazonaws.com -Fc -v --dbname="blah2" -f "/tmp/dump/20220203.dump". And it will be the same version PostgreSQL 12

Backlash answered 3/2, 2022 at 15:55 Comment(4)
Not near enough information. Need: 1) What database did you dump from, Postgres, MySQL and it's version? 2) What was the dump command? 3) What database are you trying to import into, Postgres/MySQL and version?Lopsided
@AdrianKlaver I've updated my answer with some edits, thank you for responding!Backlash
Except you have not specified the dump command or indicated whether you are dumping restoring form/to the same version of Postgres.Lopsided
@AdrianKlaver sorry! updated pls let me know if more info is neededBacklash
L
8

The easiest way to not use DBeaver at all.

Do:

UPDATED with correct command.

--In psql
CREATE DATABASE new_db;
--Exit psql
--At command line
pg_restore -d new_db -h <the_host> -p <the_port> -U postgres /tmp/dump/20220203.dump

To work in Dbeaver directly see Backup/Restore.

Lopsided answered 3/2, 2022 at 16:32 Comment(4)
I've selected this as the best answer, but if there a way to do this directly in dbeaver as well?Backlash
See my update to the answer.Lopsided
In my case, "CREATE new_db;" didn't work for me, I did need to run "CREATE DATABASE new_db;"Dosh
Well that was a stupid on my part, corrected the command. Thanks.Lopsided
B
0

Use pg_dump with tar format.

pg_dump --dbname=postgresql://username:[email protected]:5432/dbname --format=t > dump.tar

Afterwards you can restore also in DBeaver tar format.

Bale answered 23/10, 2024 at 9:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.