· Aug 8, 2019

Exporting Project whilst maintaining folder structure

Hi All,


I am currently looking for a way of exporting a project from within studio that would actually create the subfolders associated with it.  Is there an easy way of doing this.  Thanks in advance?


Kind Regards,



Discussion (11)2
Log in or sign up to continue

You might want to try using Port. It was made exactly for that purpose.

Just install the port-prod.xml and restart your Studio, note that this tool will takeover your current source control class.

After that, open your project, Source Control->Export. If your language is not supported, then you might need to change your current session to english using ##class(%MessageDictionary).SetSessionLanguage("en").


Thank you for your reply, I am already using the gitlab hook within Studio, what I wanted to do was export all the files with the relevant folder paths which I have done so using ##class(%SYSTEM.OBJ).ExportAllClassesIndividual however, if I create a project and try to export the files from within studio I can't find an easy way of maintaining the folder structure, it just exports all the classes in to one folder.

Kind Regards,


I am assuming that when you are talking about 'folders' you mean the structure which individual items are exported into when you use your source control hooks, correct?  To achieve this you need to loop over all items in the namespace and call the source-control related export on each of them.

The way we do that for our internal systems is to the the BaselineExport() method in the %Studio.SourceControl.ISC class.  %Studio.SourceControl.ISC is our source control hooks class for Perforce, and I haven't tried calling BaselineExport() while another set of hooks are configured for the namespace, it may *just work*, especially if your GitLab hooks use the ^Sources global to describe the export structure.  Give is a try and let us know if it help (if not, I can get you the code for that method and you could adopt it for your purposes)

Hi Salma!

If you import this file from this Open Exchange project it can do the export classes in folders:

Once imported call this to setup a folder:

USER>do ##class(dev.code).workdir("my/workdir/src")

Call this to export all classes, macro, deepsee resources in a given workdir.

USER> do ##class(dev.code).export()

You also can import the whole package too.



Thank you for this link it seems very useful and has pointed me in the right direction.  I noticed when I exported the code it didn't seem to pick up the look up tables or the HL7 schemas? Also I was wondering if I gave the export routine a studio project path, would it be able to export the project.  Thanks so much for this as I can start thinking of ways to tweak this.

Kind Regards,