Mass update by back-end script to Lucee Admin Datasource

Hi Lucee Seniors, good day to all !

Need your expert guidance: Is there a way to mass update by back-end script, the datasource settings in Lucee Administrator for “Host/Server:Port” as below screenshot, query by “Name” string ? Am running in Linux environment.

Thank you in advance for sharing, and appreciate all the good work in this forum. Hope to be able to contribute back one day soon.

Options

  1. Edit the lucee xml files yourself. lucee-server.xml for server items, lucee-web.xml.cfm for web items (in WEB-INF/lucee-web). See <datasources> and <datasource> entries.
  2. Use commandbox and cfconfig to export to Json, edit, reimport, or just run cfconfig manipulations directly.
  3. Use the <cfadmin> tag. Specifically “getDatasources”, “getDatasource”, and “updateDatasource”.
    https://docs.lucee.org/guides/Various/cfadmin.html
1 Like

Joe covered it well. I’d toss in a vote for CFConfig. I’m biased since I wrote CFConfig, but honestly I think it’s the least amount of work.

box cfconfig export from=/opt/lucee/etc to=mySetings.json
box cfconfig import from=mySetings.json to=/opt/lucee/etc

https://cfconfig.ortusbooks.com/introduction/getting-started-guide

1 Like

Hi Joe and Brad,

Thanks for the help, I will check it out.