Regarding External database

I’m currently using local storage in my virtual machine for NocoBase, where I’ve already created several general collections and configured forms. Now, I’d like the data entered through these forms to also appear in another database. Additionally, I want to track who adds or modifies the data.

My main concern is: if I update the .env file with new database credentials, will I be able to retain and restore all the collections, configurations, and UI I’ve built so far in NocoBase?

Could you please suggest the best approach for this integration? Specifically, I’d like to establish a two-way synchronization — where:

Any changes made in the external database are reflected in NocoBase forms, and

Any data added or modified through NocoBase forms is updated in the external database as well.

Can anyone Please let me know the most effective way to achieve this setup.

You can achieve this setup in the most stable and maintainable way by using an external data source together with workflows.

This approach has several advantages:

You can keep all your existing collections, UI, and configurations without changing the .env file.

By adding your external database as another data source, you can directly read from and write to it.

With workflows, you can synchronize data in real time — for example, when a record is created or updated in either NocoBase or the external database.

This combination lets you build two-way synchronization without custom scripts or APIs, and it’s the officially supported, most reliable solution in NocoBase.

1 Like