Import and Export Apps, Modules, Widgets, and Documents

Last modified: November 5, 2024

Introduction

In Mendix, you can import various elements others have created (apps, solutions, modules, etc.) and export elements for others to use. The Marketplace provides a platform to share components among the whole Mendix community. You can also use built-in import and export functions to share content between your own apps, import unofficial modules, and share entire apps.

There are .mpk packages that can contain apps, modules, or widgets, .mxmodule packages containing add-ons, and .mxsolution packages containing solutions.

You can import and export the following:

  • Apps
  • Modules
  • Widgets
  • Documents such as pages or microflows

Importing Various Elements

Importing App and Solution Packages

A Mendix package (.mpk) file can store a complete Mendix app.

You can also import a solution package (.mxsolution), which is a complete Mendix app that was developed as an out-of-the-box solution. In this case, the solution is set up for you. These solutions are compatible with future upgrades.

To import a complete app or solution package, follow these steps:

  1. Select Import App Package… from the File menu:

  2. Select your Mendix app package file and click Open. The Import App Package dialog box will appear:

    You have the following options in this dialog box:

    • Decide whether to store your app in a New Mendix Team Server (recommended), an Existing Mendix Team Server, Private server, or Locally on disk
    • Provide an App name (by default, it will be named as it was in the Mendix package file)
    • Determine the local folder where you would like to store your app in App directory
  3. Click OK.

The app is imported.

Importing Module Packages

Mendix modules can either be stored in a Mendix package (.mpk) file or have an .mxmodule extension if they are add-on or solution modules.

Importing a Module Package Through the App Explorer

To import module packages through the App Explorer in Studio Pro, follow these steps:

  1. Right-click your app in the App Explorer and select Import Module Package.

  2. Select your Mendix module package file and click Open. The Import Module dialog box will open.

  3. In the dialog box, choose a name for your module and select whether to create a new module or replace an existing one:

  4. Click Import. You may see a Warning pop-up window that will inform you of any included module dependencies that will be overwritten in your app.

  5. Click OK.

If you are importing a module with the .mxmodule extension, a dialog informing you about the imported add-on module is displayed:

You see a new or replaced module in the App Explorer. You also see your changes in the Changes pane.

Importing an Add-On Module Package Through the App Directory

If you would like to import an add-on module (the .mxmodule file) to your app, you can add it manually to the app directory. Follow the steps below:

  1. Go to App > Show App Directory in Explorer.
  2. Add .mxmodule file to the modules folder (you need to create this folder if it is not there).
  3. In Studio Pro, go to App > Synchronize App Directory on the menu bar.

A dialog informing you about the imported add-on module will be displayed.

The add-on module is added to the App Explorer.

Importing Documents

A Mendix package (.mpk) file can store a Mendix module document.

The package can contain a single example of one of the following:

  • Page
  • Microflow
  • Nanoflow
  • Image
  • Layout
  • Menu
  • Snippet
  • Building block
  • Page template
  • Java Action
  • Rule
  • Enumeration
  • Data Set
  • Constant
  • Regular Expression
  • Scheduled Event
  • Document Template
  • Message Definition
  • JSON structure
  • XML schema
  • Export mapping
  • Import mapping
  • Consumed web service
  • Published REST service
  • Published web service
  • Published OData/GraphQL service

To import module documents, follow these steps:

  1. Right-click a module in the App Explorer and select Import document from file….

  2. In the Import Document from File dialog box, select your Mendix package file containing the document you want to import and click Open.

  3. Click OK to import the element into your module.

Importing Widgets

A Mendix package (.mpk) file can store one or more widgets. You need to place the Mendix package file in your app directory to import it.

To import widgets, follow these steps:

  1. Click the App menu and select Show App Directory in Explorer:

  2. Open the widgets folder in your app directory and put your Mendix package file there.

  3. Open the App menu and select Synchronize App Directory to synchronize the changes in the app directory:

  4. Add your newly imported widget from the Toolbox or the Add Widget context menu.

Importing Content from the Marketplace

To learn more about importing content from the Marketplace, see How to Use Marketplace Content.

Exporting Various Elements

Exporting App Packages

To export an app, follow these steps:

  1. Select Export App Package… from the File menu:

  2. In the Export App Package dialog box, select the Package Type, the Package destination, and whether you want to export a snapshot of the data in the current development database:

    For more information on types of packages, see Export App Package.

    The Existing snapshot option will only be available when a data snapshot was created earlier using the Add snapshot of data menu option from the Team menu. It is also possible to include a new snapshot based on the current state of the local database. This option is only available after the app has been started at least once.

  3. Click Export to create the package.

The app package is created and exported.

Exporting Modules

To export a module, right-click a module in the App Explorer, and select Export module package.

If your module refers to other modules in the app (that is, it is not self-contained), you will see a warning pop-up window.

Select Find usages of other user modules to view the references, or click Continue exporting and you will see the Select Dependencies dialog box:

Here you can select files you would like to include in your package. This list includes any files in the userlib or resources folders in your app directory, as well as widgets that are used in the module you are exporting. If you do not want to include these files, you can uncheck the boxes.

Exporting Widgets

Widgets are automatically available in the widgets folder in your app directory as .mpk files.

Exporting Documents

Mendix module documents can be exported as a Mendix package (.mpk) file.

  1. Right-click the document you want to export and select Export document to file….
  2. In the Export Page to File dialog box, enter the Name for your package and click Save.

Read More