Updating CommandBox Resets the Lucee Server Admin configs?

Quick question.

I’m running CommandBox on a old Win 7 64 PC.

Lately, when I check for 'upgrade’s from the CLI, sometimes I have to re-download and re-run the box.exe so that re-configuration can happen. Fine, no issues there.

But I think the last two times I’ve done this, when I goto the Lucee Server Admin, all of my past configurations are gone. No password is set, no DSN’s are created, etc.

Is this normal? Or am I missing something b/c I didn’t RTFM? :slight_smile:

Thanks, Ché

This behavior is normal, although not necessarily desirable. What’s happening behind the scenes is a Lucee war file is unzipped and started as a server. When a new version of Lucee comes out (which often times comes along with a box.exe upgrade), a fresh war is unzipped for the new Lucee version and used. Your configurations are not automatically brought over from the old server to the new one (each server is in a separate temp folder).

To work around this, you can lock in your Lucee version in your server.json file with an exact version number. If you do this, CommandBox will never deploy a fresh war and your settings will never go away. Of course, you’ll never get a newer version of Lucee either (unless you manually update it in the admin)

I have some plans to automate the transfer of the configs in the near future that are going to be based off this project:

https://www.ortussolutions.com/blog/introducing-cfconfig-a-new-way-to-manage-your-cf-servers-configuration-from-the-command-line

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad. Glad to know this is normal and being worked on. Cheers to you and all the hard work you and others do to make CommandBox better!

Ditto on the cheers, and also ditto on the desirability of a less temporary approach to server configs.

If I already upgraded, is there any way to get back the previous configs? Or has that directory been overwritten? Would prefer not having to set everything up again for this server.

Thanks,
Dave

You can get it back easy. In fact it’s very easy if you’re on Lucee since Lucee only uses one xml file for web and server context and it’s extremely backwards compatible.

Simply open up your CommandBox home folder which is most likely here:
~/.CommandBox/server/nameOfYourServer

You should see a folder for each version of the engine you’ve started such as lucee-4.5.5.006

Inside of the version folder, you’ll find the Lucee server and web configs here:

  • WEB-INF\lucee-server\context\lucee-server.xml
  • WEB-INF\lucee-web\lucee-web.xml.cfm
    Simply stop your server, manually copy those XML files from the old folder to the new one and restart and everything should be back. If you upgraded from an old version of CommandBox before 3.4 or 3.5 (I forget which one), the folders might be a bit different. If that’s the case, let me know and I can walk you through that. We standardized the folders a while back.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad, that worked perfectly, easy.

I’d suggest that that should be the default CommandBox behavior, or at least an option, or it should ask if you want to clone the configuration from a previous version if one exists.

Dave

Yes, that’s exactly what I have planned with CFConfig. I needed to build a tool first that would migrate configuration between different versions of engines first before I could automate that. In many cases, the config files may be copied directory, but that’s not always a safe assumption to make. CFConfig will be the translation layer that makes sure the config gets read and written properly based on the versions it’s being moved between.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com