Export and import web application configuration
Is there a way to export and import web application configuration? For example to save it to version control (git) and to import it to other server.
By web application configuration I mean "System -> Security Management -> Web Applications". Sreenshot from it:
Comments
this information is stored in ^|"%SYS"|SYS("Security","ApplicationsD")
you could extract it by MERGE ^mySAVE=^|"%SYS"|SYS("Security","ApplicationsD")
and then do any export of the global
Yes, there is a way using ^SECURITY routine in %SYS namespace in Terminal.
You can export single application or all of them.
USER>zn "%SYS"
%SYS>d ^SECURITY
1) User setup
2) Role setup
3) Service setup
4) Resource setup
5) Application setup
6) Auditing setup
7) Domain setup
8) SSL configuration setup
9) Mobile phone service provider setup
10) OpenAM Identity Services setup
11) Encryption key setup
12) System parameter setup
13) X509 User setup
14) KMIP server setup
15) Exit
Option? 5
1) Create application
2) Edit application
3) List applications
4) Detailed list applications
5) Delete application
6) Export applications
7) Import applications
8) Exit
Option? 6
Export which applications? * => ?
Num Name Namespace
1) /api/atelier %SYS
2) /api/deepsee %SYS
3) /api/iknow %SYS
4) /csp/ensdemo ENSDEMO
5) /csp/ensemble ENSEMBLE
6) /csp/samples SAMPLES
7) /csp/samples/docserver SAMPLES
8) /csp/user USER
9) /isc/studio/usertemplates %SYS
10) /csp/broker %SYS
11) /csp/docbook DOCBOOK
12) /csp/documatic DOCBOOK
13) /csp/sys %SYS
14) /csp/sys/bi %SYS
15) /csp/sys/exp %SYS
16) /csp/sys/mgr %SYS
17) /csp/sys/op %SYS
18) /csp/sys/sec %SYS
19) /isc/pki %SYS
20) /isc/studio/rules %SYS
21) /isc/studio/templates %SYS
Export which applications? * => 6
Export which types of applications (1=CSP,2=Routine,3=Executable)? * =>
Export to file name ApplicationsExport.xml =>
Parameters? "WNS" =>
Confirm export of Applications records to ApplicationsExport.xml? No => yes
Export of 1 applications records complete
How about using the Export and Import methods of Security.Applications ?
Yes,
there is an API to export and import web-applications info to and from file.
To export:
%SYS>write ##class(Security.Applications).Export("c:\temp\webapp.xml",.n,"/csp/samples,/csp/user")
To import:
%SYS>write ##class(Security.Applications).Import("c:\temp\webapp.xml",.n)
1
%SYS>write n
2
Does anyone know how to specify the Type in the Export method of Security.Applications, I want to export only the client applications (without having to specify all the different applications in the 3 parameter)
This method exports Application records to a file in xml format.
Parameters:
FileName - Output file name
NumExported (byref) - Returns number of records exported
Applications - Comma separated list of Applications to export, "*" = All
Type - Type of applications to export, -1 = all
Bit 0 = System Application - Reserved
Bit 1 = CSP Application
Bit 2 = Privileged routine application
Bit 3 - Client Application
Only Client application is Bit 3 only, so in binary:
1000 = 8 decimal
Pass 8 as Type parameter.
You also can export the webapp and deploy it using IPM. The module.XML can be generated (and get the WebApp features) via the 'generate' command. Learn more in this article.