Charles Robertson
04/20/2023, 10:48 AMneo-datasources.xml
Into a format that we can import into Lucee
Both application servers are standalone servers, but we are allowed to install commandbox on the boxes
I have created a small app that uses Lucee's brilliant import method:
variables.config = ConfigImport(
data=variables.data,
type='server',
password=variables.adminpassword
);
So, the idea would be to deserialise data, from a file [I guess JSON would be easiest], into a struct that could then be handled by ConfigImport()
I have had a look at:
https://www.forgebox.io/view/commandbox-cfconfig
But I wasn't sure whether it could convert an XML file into JSON, or whether I would have to write the routine to do this from scratch?
I cannot have both the ACF and Lucee servers, running on the same box.
Only the Lucee standalone server is running.
So, I am going to have to work at settings file level.Patrick
04/20/2023, 12:23 PMRodney
04/20/2023, 12:28 PMhelp cfconfig export
and help cfconfig import
for documentation and examples.Dave Merrill
04/20/2023, 12:33 PMRyan Albrecht
04/20/2023, 12:44 PMbdw429s
04/20/2023, 2:35 PMincludeLIst
to export only datasources if you need.bdw429s
04/20/2023, 2:39 PMcfconfig export from=C:/coldfusion2021/cfusion to=.cfconfig.json
and then you can just drop that JSON file in the webroot of the CommandBox server and it will get picked up when CommandBox startbdw429s
04/20/2023, 2:39 PMcfconfig import .cfconfig.json
Charles Robertson
04/20/2023, 3:24 PMCharles Robertson
05/11/2023, 9:06 AMcfconfig export from=C:\Users\ADMCharlesr\Desktop\work\xml\neo-datasource.xml to=C:\Users\ADMCharlesr\Desktop\work\xml\.cfconfig-datasource-export.json
And I got this:
File is not valid JSON. [C:\Users\ADMCharlesr\Desktop\work\xml\neo-datasource.xml]. Operation aborted.
Charles Robertson
05/11/2023, 9:49 AMcfconfig export from=C:\Users\ADMCharlesr\.CommandBox\server\02CE1AF3E66B5B8AF1259F8CF863C257-acf11019314546CB5_domains2\adobe-11.0.19.314546\WEB-INF\cfusion to=C:\domains\acf11-0-19_314546-cfconfig\json\.cfconfig-export.json
And I now get a json
file, full of config? So, this is a great improvement. π
However, there is one big problem, there are no datasources, in the config file?
And this is actually the whole reason why I wanted to do the export, in the first place.
I have checked the
C:\Users\ADMCharlesr\.CommandBox\server\CC852531F91E59BD5E842D9547526422-acf11019314546cfconfig\adobe-11.0.19.314546\WEB-INF\cfusion\lib\neo-datasource.xml
And it contains 44KB worth of datasource information. So, there are plenty of datasources for it to convert.
It has successfully converted:
C:\Users\ADMCharlesr\.CommandBox\server\CC852531F91E59BD5E842D9547526422-acf11019314546cfconfig\adobe-11.0.19.314546\WEB-INF\cfusion\lib\neo-debug.xml
So, it can't be anything to do with the WDDX tags? It maybe that the neo-datasource.xml, is too big in size. Maybe cfconfig
cannot place the file contents, into to memory?Charles Robertson
05/11/2023, 10:40 AMCharles Robertson
05/11/2023, 11:01 AMneo-datasource.xml
to JSON, within about a second.
Thatβs 1.2MB config file, in the time it would take you to blink.
That has just saved my manager a weekβs work, and has put me in his good books. π
Thank you @bdw429s at Ortus. ππ»bdw429s
05/11/2023, 5:52 PMbdw429s
05/11/2023, 5:52 PMbdw429s
05/11/2023, 5:52 PMbdw429s
05/11/2023, 5:52 PMThefolder that contains thecfusion
file. An example would be:lib/neo-runtime.xml
C:/ColdFusion11/cfusion/
bdw429s
05/11/2023, 5:53 PMcfconfig transfer from=acf11019314546cfconfig to=myfile.json
bdw429s
05/11/2023, 5:54 PMbdw429s
05/11/2023, 5:55 PMcfconfig transfer from=acf11019314546cfconfig to=myfile.json include=datasources