Reputation: 153
I have a Postgres database schema in machine A, I want to copy the whole database schema into machine B using Dbeaver. How can I do that?
Upvotes: 2
Views: 6801
Reputation: 556
Edit: To use DBeaver to export a schema you can right click on the schema and then tools > backup. There select the schema you want to export. Details can be found here
You should take the backup using pg_dump. To take a dump from a remote server you should run the following
pg_dump -h host_address -U username -s schema_name -Fc database_name > dump_file_path.sql
This will create a SQL dump of the selected schema. Then you can use PSQL or DBeaver to import and create the schema in your server B or database B.
To do it with psql you should run the following -
psql "sslmode=disable dbname=_db_name_ user=_user_ hostaddr=_host_" < exported_sql_file_path
Upvotes: 2