Guide to DBeaver
DBeaver is a database manager. DBeaver lets you add rows in its GUI without writing any SQL. This guide walks you through a number of basic tasks commonly encountered in managing LTER-core-metabase.
Installation
- Install Postgres for Windows using the EnterpriseDB installer.
- Install DBeaver.
- Run DBeaver and connect to your Postgres instance.
Backup a database to SQL file
- In DBeaver, right-click the database and click Tools > Backup.
- Select schemas to include and click Next.
- For Format, choose Plain.
Optional: You might choose to make the backup without ownership or privilege statements. This makes it easier to restore to a different server. However, note that the user restoring the database from SQL backup will become the new owner.
- Place a check next to these boxes:
- Do not backup privileges (GRANT/REVOKE)
- Discard objects owner
- Click Start.
Restore a database from a SQL export
Use these steps to restore a database from a database backup saved as a SQL file, i.e., 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.
Import data to a table from CSV
- Navigate to a table, right-click on it, then click Import Data.
- With CSV selected, click Next.
- For Input files, in the Source column, click none to open a file browser.
- Browse to the CSV file and click Open.
- Click Next and preview the data if desired.
- Click Next, Next, and Finish.
- Open the table (or refresh the window if the table was already open) to see the data.