How To Use Your Mendix Cloud Database locally

UPDATE 29 JAN 2019

When using PGAdmin4 and restoring you DB, the process is still very much the same but there is one key difference. You need to select the “Restore Options” tab and be sure to turn on restoring data. It no longer does that by default. If you don’t do this, you will only upload the structure of the db. See the image here for details, and happy developing!

Recently I needed to do this for a project and installed the latest version of PostgreSQL and PGAdmin and found the interface had been changed. This guide still applies mostly so I won't change all of that, but I did want to point out a key change. When you are restoring your data, you MUST go into the options of the restore and check the boxes to add the data specifically. Otherwise, by default, it will just restore your tables, indexes, etc. Hopefully this saves you the 5 minutes of banging your head against the wall that I spent!

Recently I was asked to help out on a Mendix project. In order to test changes in the Business Modeler, I needed to get a copy of the data from the Acceptance environment so I could use it locally. I hadn’t needed to do this before so I put together a quick guide to help walk me through the process. I thought it made sense to share on my blog for others that might need to do this.

Step 1 – Install PostgreSQL server

Navigate to their home page and click on 'Downloads'.

Select your distribution. We’re going to show the “Windows” process since the Business Modeler currently only runs on Windows so we know you’ll at least have access to a Windows OS.

Once downloaded, run the installation and accept the defaults. You can change the path of the install but leave the rest as-is.

Step 2 – Download the Mendix cloud database

Navigate to the Mendix Developer Portal.

Once you’ve selected your project, click on the ‘Deploy’ menu item, then the ‘Backup’ tab.

From here, select your environment that you want to make a local copy of, select the deployment you want to make a copy of (the top one will be the current deployment) and press the ‘Download Backup’ button.

In the popup page, download the “Database” option.

Step 3 – Setup your local database

Run the PgAdmin III utility.

Once launched, you might need to connect to your PostgrSQL database engine on your localhost. Simply right-click (or equivalent) on that database and select “Connect”.

After the connection, right-click on ‘Databases’ and select “New Database…”. Give it a name and click “OK”.

Step 4 – Restore the downloaded backup to your new database

Right-click on your new database and select the ‘Restore’ option.

Click on the ellipse button and navigate to and select your backup file downloaded from the cloud. Click ‘Restore’.

This process will take time. Continue with something else in the meantime and check back now and then to see if the screen shows complete or “Process returned exit code…”. If you see that the process is over. The ‘Restore’ button will be selected again but don’t choose that. Just select the ‘Cancel’ button.

Step 5 – Configure the Project in the Modeler

Launch the application in your Business Modeler and double-click on “Project/Settings”.

Select ‘New’ on the ‘Configurations’ tab.

Fill in the ‘Database’ form with the following settings:

  • Type: PostgreSQL

  • URL: localhost

  • Database Name: <your DB name>

  • User Name: <the Admin DBO account setup on you DB>

  • Password: <the Password you setup.>

  • Press ‘OK’

There you are. A step-by-step procedure for moving the Database from the cloud in Mendix to your local machine.