I created a custom module using Module Builder and added several fields to it. Now I want to duplicate this module, but when I copy the module, only the module structure is copied — the fields are not included.
Is there an option in SuiteCRM to copy or duplicate a module along with all its custom fields?
Or do I need to manually recreate the fields in the duplicated module?
Any guidance or recommended method would be appreciated.
@BastianHammer I need your help
@BastianHammer I need your help

How do you want to work / duplicate it?
From dev to live? Then you’d basically publish and install it in the live version.
If you look into the folder:
public/legacy/custom/modulebuilder
you’ll find the code that the module builder generates.
Here, it would be possible to interfere. But overall, I assume you’ll be faster just re-entering a dozen fields and placing them again on your layouts instead of figuring out how the system underneath works.
If you have to do this multiple times in the future, maybe it would be best to deploy relatively “empty” modules and copy the fields via the vardefs. Alternatively, you can avoid the module builder all together and develop directly in code - works as well but mostly makes sense if you have a team of developers, use github / versioning / deployment pipelines etc.
What’s your business case / requirement behind it?
Hi @octavebytes
The query is already answered but there are more approaches one of them is:
Use a “Base Module Template” and Generate the Copy
If you’ll repeat duplication across many projects, create a template module in code:
/custom/modules/_TEMPLATE/
/custom/Extension/modules/_TEMPLATE/Ext/Vardefs
/custom/Extension/modules/_TEMPLATE/Ext/Layoutdefs
Then write a script (or manual process) that:
copies the folder,
replaces _TEMPLATE with the new module name,
updates table names,
creates an installable module loader package.