Copying user roles between an existing module and a new one - is it possible?

My project has grown to a really huge size. I would like to divide it into modules to make it more convenient to work on it. Although with the Domain Model itself now it is simply unreadable. However, how to transfer User Roles to new modules as well? When creating a new module, I don't have any user role from the App. When I add a new role in App of course I can also create it in the new module. But how to add all the roles (there are about 15 of them) to the new module. I would like to create about 8 modules and creating duplicate user roles manually (120 times...) seems terrible and pointless. From the user role settings in the application, of course, I can give access to a specific (for example, this new) module but when I move an entity (I think it will be so with each element) from the old to the new module in the entity settings I have the access rules copied but Studio shows an error that the roles have not been created in the module (and indeed they are). The alternative is to delete and create roles from scratch and give them different permissions from the scratch but that seems pointless. Is it possible to "copy" already existing roles to a new module?
4 answers

Nope. Copying roles between module is not a function that is available in Mendix Studio Pro.

What you can do is:

- export the module

- import the module; A popup will ask: ‘as a new module’ or ‘overwrite existing’. Select ‘as a new module’

and continue building from there.  


I don't really understand.

I would like to "split" the module into several smaller ones (within one app). I expect that exporting and then importing will cause me to have the entire domain model copied from the main module (probably with all the names changed).

I would like to move the pages, microflows and selected data model elements to the new module to have more control over the various elements of the application.

The particular problem is with the domain model because it currently looks like the one below making it totally difficult to understand. For these reasons, I would like to extract selected elements of this model to other modules.


Hi Marc,

you can export the module and import it in ur respective application.


check the below documentation for reference

Export module:


Import Module:


Hope it helps!!!




Right-click on an entity in the domain model, "move to" will do the job.



Refer the below link for reference