Working with SVN On-Premises Version Control Server

Last modified: August 20, 2024

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. For version control, Mendix uses the Subversion system (also known as SVN) and Git. This document describes how to work with SVN version control system.

Prerequisites

Make sure you have completed the following prerequisites:

  • 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.

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.

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 document, 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.

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:

  1. Click New App on the My Apps page.
  2. In the App Settings dialog box, click No for Enable online services.
  3. In the top menu of Studio Pro, go to Edit > Preferences > Advanced and make sure the Enable private version control box is checked.
  4. In the top menu, select Version Control > Upload to Version Control Server.
  5. In the Upload to Version Control Server dialog box, select Private server.
  6. 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).
  7. 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. In this case a Team Server app is created automatically.

  1. Click Create App in Apps.
  2. 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).
  3. 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.
  4. Wait for confirmation from Mendix Support before continuing the process.
  5. With all instances of Studio Pro closed, open the folder in which your app is stored locally.
  6. 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.
  7. Double-click the .mpr file in the app 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 above mentioned local .mpr file to open your app.
  8. 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.
  9. In the top menu, select Version Control > Upload to Version Control Server.
  10. In the Upload to Version Control Server dialog box, select Private server.
  11. 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).
  12. Click OK to connect to the server.

Read More