If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.
Work with an On-Premises Version Control Server
Introduction
When developing Mendix applications, changes to these applications are stored in a version control system. This system is called Team Server and is part of the Mendix Platform. This means that the application’s files are stored in the Mendix online environment. For more information, see Version Control.
While this is the recommended way of working for almost all Mendix developers, you may prefer to store your application’s files in a system that is controlled by your own organization.
This how-to teaches you how to do the following:
- Configure your Mendix apps to work with your own (on-premises) version control system
Prerequisites
Before starting this how-to, make sure you have completed the following prerequisites:
- Have knowledge of Subversion
- Have access to an SVN server and possess credentials (username and password) that give you access to that SVN server
- Know the location of the SVN server – usually this is an address similar to an internet URL (for example,
https://svn.example.com:9876/repos/myapp
)
Repositories
Subversion uses repositories for storing all the data of your version-controlled app. Each Subversion server can contain many different repositories.
For the purposes of this how-to, there are two important points to know about repositories.
First, Mendix requires you to store each Mendix application in a separate repository. It is not possible to place multiple Mendix apps into a single repository.
Second, when uploading an app to a repository, Mendix requires the repository to be empty (except for the recommended SVN layout, as described in Recommended Repository Layout). Specifically, this means that the repository should contain only three empty folders, called branches, tags, and trunk.
Usually, repositories are created and maintained by the administrator of your SVN server. For more details about repositories, see Repository Administration.
In the following sections of this how-to, it is assumed that you have a repository available for your application.
SVN Versions
Mendix Studio Pro has a (built-in) Subversion client that uses version 1.9 of the SVN working copy format. This client should be compatible with any 1.x version of the SVN server, so you could use, for example, a 1.6.x or 1.9.x SVN server as well.
Mendix Studio Pro uses the Subversion 1.9 working copy. Previous versions of the Mendix Desktop Modeler used a Subversion 1.7 working copy. These working copy versions are NOT compatible.
This means that, if you use a separate SVN client (for example TortoiseSVN) to work on your Mendix app, you must always use the version which matches your app model. If you open a local model from Mendix 7.x with the latest version of TortoiseSVN, you will no longer be able to open it in Mendix.
Creating a New App to Store in an On-Premises SVN Server
To create a new app to store in your on-premises SVN server, you must create the app from Studio Pro by following these steps:
- Click New App on the My Apps page.
- In the App Settings dialog box, click No for Enable online services.
- In the top menu of Studio Pro, go to Edit > Preferences > Advanced and make sure the Enable private version control box is checked.
- In the top menu, select Version Control > Upload to Version Control Server.
- In the Upload to Version Control Server dialog box, select Private server.
- In the App repository address field, enter the address of your SVN server. This address must include the name of the repository you are going to use for your app (for example,
https://svn.example.com:9876/repos/myapp
). - Click OK to connect to the server.
Moving an App from Mendix Team Server to an SVN Server
To look at moving an app from Mendix Team Server to a private SVN server, we will use the scenario of creating a new app in Apps, wherein a Team Server project is created automatically.
- Click Create App in Apps.
- After you have created your app, click the arrow next to Edit App, select Edit in Mendix Studio Pro, then open the app in the relevant Studio Pro version. You need to open your app in Studio Pro in order to download it to your local machine (for more information, see Version Control).
- Your app contains a link to the location of the Mendix Team Server by default. To replace this with the address of your own SVN server, create a ticket in the Mendix Support Portal specifying your app and the address of your SVN server. This address must include the name of the repository you are going to use for your app (for example,
https://svn.example.com:9876/repos/myapp
). This will allow Mendix Support to change the URL of your app. - Wait for confirmation from Mendix Support before continuing the process.
- With all instances of Studio Pro closed, open the folder in which your app is stored locally.
- Delete the .svn and .mendix-cache folders (note that these folders may be hidden, in which case you will need to enable the option in your file explorer to make them visible). By deleting these folders, references to the Mendix Team Server are removed. Now, your app is ready to be uploaded to your own SVN server.
- Double-click the .mpr file in the project folder to open the app again in Studio Pro (for example, if your app is called MyApp, this file will have the name MyApp.mpr). Alternatively, you can start Studio Pro, click My Apps > Open App, and browse to the abovementioned local .mpr file to open your app.
- When the app is opened in Studio Pro, go to the top menu, select Edit > Preferences > Advanced, and make sure the Enable private version control box is checked.
- In the top menu, select Version Control > Upload to Version Control Server.
- In the Upload to Version Control Server dialog box, select Private server.
- In the App repository address field, enter the address of your SVN server. This address must include the name of the repository you are going to use for your app (for example,
https://svn.example.com:9876/repos/myapp
). - Click OK to connect to the server.