restoring postgres database

5
I received an MPR and a postgres database backup from one of my co-workers. I would like to restore the database locally so I can test the project. first i let the modeler create a new database and then i tried to restore the backup in postgres. This gave me a lot of errors. Then I tried to create a new empty database and restored and changed the server name in the modeler. This worked. is there a default sequence I should follow for restoring a project database in Postgres? Han Pieter
asked
3 answers
13

The preferred way to restore a project database is the second method you mentioned.

Before you restore the database, first create a new database directly on the database server, for example with pgAdmin. Then restore the backup to this database. In test cases it is recommended to select the option ‘No owner’ in the Restore options window when the backup came from a different server, because it can cause problems with access to the database when the security settings on the target database server differs from the settings on the source database server.

Don’t let the MxRuntime create the new database in this case, because then automatically some system tables are created. For the restore action, it is better that the database is entirely empty.

answered
7

When restoring the database make sure you have the option "no owner" checked.

answered
5

The reason that you get a lot of errors, is that the modeler (personally the xas) export it's metamodels to the database. So, when you try to restore your database backup on the database that the modeler have created you get many conflict.

For example: the modeler have created a system$user table, and your database backup wants to restore the same table. And that is the conflict.

So there is no other way than to first drop your database and than restore it with your database backup. Thus you haven't to change you databasename in the modeler, but you have to drop the database from postgres server before restoring it.

Herbert

answered