restore table in mendix environment

Does anyone knows the best way to restore just a table in production environment? There was a problem with one of the columns, we've fixed it locally and would like to upload the fixed data back onto production. I assume the restoredb would not cut it, I might have to use the pslq console. If anyone has done this would you point me in the right direction? Many thanks, LR.
3 answers

If "a problem with one of the columns" could be fixed using a one-shot 'repair-microflow', doing this with a microflow might be a prefered way, because if something technically unrelated breaks in your database, you can at least blame Mendix :-)

When operating directly on the database, you have to be perfectly sure about what you're doing.

If you did fix your data locally by executing a SQL query (e.g. UPDATE table SET foo='bar' WHERE baz), you could choose to execute these (well tested) queries directly on your production database. (using the psql command on the linux prompt, or at the m2ee prompt, you can login to the database directly)

If you want to restore a single table from a backup, you should only do that if:

  • the application is not running
  • you emptied the table that you want to restore using psql ("TRUNCATE TABLE foo;")
  • the backup table still contains the same objects (rows) as the original data, but possibly with altered data in several objects

...because else:

  • you might get problems with associations...
  • ...and with object-id-sequences.

The command to do this on the linux prompt looks a lot like:

pg_restore -d < database > -O -x -t < tablename > < dump.backup >

where you need to fill in the 'blanks.


Contact the support desk. They can give you a manual on how to connect directly to the database in the cloud. You may have to experiment a bit because last time I did this the manual was not all clear on all the steps but with the helpdesk we sorted this out.


You can of course include the Excel importer module in your project and write import mapping(s). With that you can import the data. This works only for a small amount of tables.