Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore a PostgreSQL database from dump file in dbeaver?

In our company we have a dump of PostgreSQL database - file db.sql. It weighs 8 Gigabyte. How to restore this database in DBeaver? And we don't have another databases in DBeaver 7.0.5.

I have digged all Internet and haven't found anything how to do this without another database/

like image 391
Mary Smith Avatar asked Jul 17 '20 14:07

Mary Smith


People also ask

How do I restore a DBeaver database?

Restore a database from a SQL export Make a new database: right-click on an existing one and click Create New Database. Right-click the database and click Tools > Execute script. Select the SQL file and click Start. You may need to restart DBeaver to see the schemas and tables.

How do I open a dump file in PostgreSQL?

PostgreSQL Dump Import process can be carried out using psql command. You can use the psql utility to recover the SQL script file created by pg_dump, pg_dumpall, or any other tool that creates compatible backup files. You can run the complete script in the dump file with the psql tool.


2 Answers

When you right click on the database you want to restore into, under "Tools" you will find "execute script". This is how you restore a plain-format dump file, which is what db.sql probably is.

This will require you to have psql, but dbeaver will offer to download and install its own copy of it for you.

like image 68
jjanes Avatar answered Oct 19 '22 05:10

jjanes


Create a new DB and right click on the db, click on tools and restore. Choose your dump and import it.

like image 2
Lenny Avatar answered Oct 19 '22 05:10

Lenny