Migrate data from Microsoft SQL database to Postgres

Our customer is running an very old (Mx 3.0.0) "on premise" application. They asked us if it is possible to run the application from the default cloud solution from Mendix. Therefor i need to migrate the data from Microsoft SQL database to a Postgres database in order to keep the data. Otherwise i will need a lot of "export/import" files. Tips/Tricks are more than welcome.
3 answers

Hello Richard,

Since you can not use the database replication module because it will not connect to the Microsoft SQL database I would create export tables in the old application and use the csv export function on those tables. Not probably what you want to hear because this can be quite time consuming creating tables for every entity that you have. But unless someone has a sollution for the database replication module to work on a MS SQL database it may be your only option. Or create webservices for all your data. Let the old application expose the webservice and let the new application consume the webservice. But this may be even more time consuming.



[EDIT] My mistake. The database replication module does connect to MS SQL. Than you should this module to map all the old data to the new postgres database.


I once did the same thing, but from Oracle to Postgres. This takes a serious amount of work, both in setting up the tools to do this and in some manual work (column lenghts are different in different database types, so you will need to do some manual renaming there).

You're actually lucky that the application is still on Mx 3, as this stores less metadata about the database in the database than Mx4 and 5, so there's less that needs to be manually corrected.

I am happy to have a chat about the way I did this and what I ran into.


You could also consider the possibility of developing services to transfer data from one app to the other. This also enables you to do changes on the data or use a different (improved) domain model. I would advise to work in batches when handling a lot of records.