Import from and apply to a database
Bring the structure of an existing database into a model, and apply a model to a database.
Import from a database
- Open File › Import › From DB.
- Enter the connection details and connect. The drivers for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite are built into the app, so there is nothing else to install.
- Choose the schemas to import.
- Choose the tables, views, sequences and triggers and add them to the document. The whole import is undone with a single Ctrl+Z.

Apply to a database
- Creating it for the first time — File › Export to DB… (also on the toolbar). The SQL to run is shown first; on databases that support it, everything runs in one transaction and is rolled back if a statement fails.
- Applying only the changes — Generate migration SQL (ALTER) from the differences between the model and the database structure.
- In a new diagram, use Import from DB to bring in the current database structure, and save it as a file (for example
db-now.erm). - Open the model you want to apply and choose that file in File › Compare and merge › Compare with another file….
- In the comparison view, choose Export ▾ › Generate migration SQL (PostgreSQL, MySQL, MariaDB, SQL Server, Oracle).
- Check the warnings about risky changes and the "Manual step required" list, then run the SQL yourself in your database tool. Relio never runs this SQL.
- In a new diagram, use Import from DB to bring in the current database structure, and save it as a file (for example

Warning
Always read the SQL before running it on a real database, and back up production databases first.
For Oracle, prepare the Oracle Instant Client folder first; for Db2, Informix and MS Access, the ODBC driver. H2 and HSQLDB cannot be connected to directly, so export a DDL file and run it. Database passwords are stored in the Windows Credential Manager by default.
More → Databases · Git and merging › Generating migration SQL · Help and troubleshooting