Export your database schema directly from DBeaver's menu
DBeaver can export your database schema — the structure of your tables, columns, keys, and relationships — in several formats. The fastest route is to right-click your database or schema in the left panel, select Export, and choose your format. DBeaver will then walk you through options for what to include and where to save the file.
The export process takes a few minutes for most databases. You can export the entire database, a single schema, or just the tables you select. The resulting file is a text document (usually SQL, XML, or CSV) that you can open in any text editor, import into another database tool, or share with colleagues.
Key Takeaways
- Right-click your database or schema in the left panel and select Export to start the process.
- DBeaver offers multiple export formats including SQL, XML, CSV, and JSON depending on what you need the schema for.
- You can choose to export table structure only, data only, or both structure and data in a single file.
- The export dialog lets you filter which tables to include before the file is created.
Step-by-step export from the DBeaver interface
Open DBeaver and connect to your database if you are not already connected. In the left panel under Database, find the database or schema you want to export. Right-click it and look for the Export option in the context menu.
A dialog box will open asking you to choose an export format. The most common choice is SQL, which creates a text file containing the CREATE TABLE statements and other SQL commands needed to rebuild your schema in another database. Select SQL and click Next.
On the next screen, you will see options for what to include: table structure, table data, or both. If you only want the schema (the shape of the tables, not the rows inside them), uncheck Export data and leave Export DDL checked. DDL stands for Data Definition Language — the SQL commands that define your tables.
Click Next again. You will see a list of all tables in your database. Uncheck any tables you do not want to export. This is useful if your database is large and you only need a few tables. When you are satisfied with your selection, click Next one more time.
Choosing the right export format for your needs
DBeaver offers several export formats, and the right one depends on what you plan to do with the file. SQL is the standard choice if you want to recreate the schema in another database or share it with developers. The resulting file contains all the CREATE TABLE, CREATE INDEX, and other commands needed to rebuild your structure from scratch.
XML format exports your schema as structured data that other tools can read. This is useful if you are moving data between different database systems or if you need to parse the schema programmatically. CSV format exports each table as a separate comma-separated file, which is helpful if you want to open the data in a spreadsheet or import it into a different application.
JSON is another option that represents your schema as nested objects. This format works well if you are building a web application or need to integrate the schema into a JavaScript-based tool. Choose the format that matches the system you are sending the file to.
Filtering tables and customizing what gets exported
Before DBeaver creates your export file, it shows you a checklist of every table in your database. You can uncheck tables you do not need, which saves time and keeps your export file smaller. This is especially useful if your database contains hundreds of tables but you only need to document or transfer a handful.
You can also control whether DBeaver exports just the table structure (column names, data types, constraints) or includes the actual data rows as well. For schema documentation or sharing the design with another team, structure-only is usually what you want. If you are migrating data to a new system, you will want both structure and data in the same file.
Some export formats also let you choose whether to include indexes, foreign keys, triggers, and other database objects. The SQL format includes these by default, which is why it is the most complete option for recreating a database elsewhere.
Where DBeaver saves your export file
On the final screen of the export dialog, DBeaver asks you where to save the file. By default it suggests a location on your computer, usually your Downloads folder or Documents folder. You can click Browse to choose a different location, or type a custom filename if you want to name it something other than the default.
The filename usually includes the database name and the date, like my_database_2024-01-15.sql. You can change this to anything you want. Once you have chosen your location and filename, click Finish. DBeaver will create the file and show you a confirmation message when it is done.
The file is now saved on your computer as a plain text document. You can open it in any text editor, email it to a colleague, or import it into another database tool. If the file is very large, it may take a moment to open in a text editor, but it will open.
Exporting specific tables instead of the whole database
If you only need to export one or two tables instead of your entire database, you can start the export from a smaller level. In the left panel, expand your database to show the Tables folder. Right-click the specific table you want and select Export. DBeaver will then export only that table and its structure.
You can also select multiple tables at once by holding Ctrl (or Cmd on Mac) and clicking each table name, then right-clicking and choosing Export. This is faster than exporting the whole database and then deleting the tables you do not need from the file.
The export process is identical to exporting the entire database — you still choose your format, decide whether to include data, and pick a location for the file. The only difference is that your file will be much smaller because it contains fewer tables.
Troubleshooting common export issues
If DBeaver shows an error during export, the most common cause is a permissions issue. Make sure your database user account has permission to read the schema. If you are exporting to a network drive or shared folder, check that you have write permission to that location.
If the export completes but the file is empty or incomplete, try exporting again and make sure you did not accidentally uncheck all your tables in the filtering step. You can also try exporting to a different location on your computer to rule out a folder permission problem.
For very large databases, the export may take several minutes. DBeaver will show a progress bar. Do not close the dialog or disconnect from the database while the export is running, or the file may be corrupted.
Frequently Asked Questions
Can I export just the table structure without any data?
Yes. In the export dialog, uncheck the Export data option and leave Export DDL checked. This creates a file with only the CREATE TABLE statements and indexes, not the rows inside the tables.
What format should I use if I want to import the schema into a different database system?
SQL is the safest choice because it works with almost every database system. If you are moving to a specific system like PostgreSQL or MySQL, SQL will work. For specialized systems, check the documentation to see if they prefer XML or JSON format.
Can I export a schema that I do not own?
You can export any schema that your database user account has read permission for. If you cannot see the schema in DBeaver's left panel, you do not have permission to read it. Ask your database administrator to grant you read access.
How large can the export file be?
DBeaver can handle databases with thousands of tables. The file size depends on how much data you include. Structure-only exports are usually small (under 1 MB for most databases), but if you export data as well, the file can be very large.
Can I schedule exports to run automatically?
DBeaver's graphical interface does not have a built-in scheduler, but you can use command-line tools or scripts to automate exports. Check DBeaver's documentation for command-line options if you need regular automated backups.