Welcome to our engineering blog, where we share the learning experiences we’re engaged in daily. This time, we’re focusing on low-code development in Unit 2.
Today’s Theme: Migrating Outsystems Database to an External DB
In Outsystems, you can request a free cloud version called the Personal Environment (PE) by creating an account. (What is an OutSystems Personal Environment – OutSystems Support)
Using this environment, you can develop personal applications for small-scale users and are provided with 2GB of database storage.
However, there are some inconveniences, such as limited storage capacity and the inability to access the database directly from external sources. To address these issues, we decided to migrate the internal database created in Outsystems to an external database while keeping the table definitions unchanged. Below are the results of this migration.
Environment Information
Personal Environment: Version 11.31.0 (Build 43948)
Service Studio: Version 11.54.80 / Build 63652
Data Extractor: 1.4.0
About Data Extractor
By using Data Extractor, freely available on the Forge, you can obtain the actual table DDL corresponding to the Entities created in Outsystems. Here’s how to use it:
- Install “Data Extractor” from the Forge.
- Launch the application via “Open In Browser.”
- Log in by entering your ID and password.
- Create a new snapshot by clicking “New Snapshot” on the top page.
- Configure the new snapshot with the following settings:
・Snapshot Name: Give your snapshot a name. Any name is fine.
・Extract Configurations: Check the “Table DDL” option. Other items are optional.
・Extract Entities: Add the Entities for which you want to output the DDL to the list.
Use the “Search Entity to Add” feature to find Entities by prefix matching. Select the desired Entity and click “Add” to include it in the list.
・Other Items: Optional. Configure as needed. - Click the “Run” button. Your snapshot will appear in the list on the top page with the status “Created.” Once the status changes to “Done,” you can download it by clicking the “↓” icon on the far right.
- Contents of the downloaded Zip file:
・[TableName].csv.gz: Export of data registered in the Entity.
※Note: In our testing environment, Japanese characters were displayed as “?” and could not be read correctly.
・TableDDL.Create.sql.gz: DDL of the actual table corresponding to the Entity.
※Includes the following:
・Create Table statements
・Alter Table statements to add foreign key constraints to columns of the Entity Identifier type
・Create Index statements to add indexes to columns of the Entity Identifier type
By executing the Create Table statements obtained through these steps, you can create tables with the same layout as the internal database on your own SQL Server.
To reference the tables created in the external database from Outsystems, you’ll need to create a Database Connection via the Service Center and then set up the connection to the tables through “Connect to External Table or View” in Integration Studio.
Summary
- Outsystems provides an internal database by default.
- To migrate to an external database, you can obtain the Entity’s DDL using the Data Extractor from the Forge.
- For data migration, alternative methods may be necessary since columns containing Japanese characters might become garbled.
- Referencing tables in the external database requires creating a Database Connection and setting up connections through it.
How did you find this guide?
We hope these steps will be helpful when you consider externalizing your own database in the future.
Our Unit 2 team will continue to share engineering blogs using low-code tools like OutSystems, so stay tuned!