On 3/28/2012 6:04 AM, Spadez wrote:
I am writing a bash script which will install SOLR. I had two quick
questions:

Is there a way to update SOLR, changing only the files which have changed
from the previous version, or is it a case that I need to fully uninstall
the old version and then reinstall the newest version.

Secondly, when I update SOLR to the newest version, will it overwrite my
configs? I.e would I have to re-edit my configuration files, or does the
update leave these alone.

Solr is not truly what one could call an application. The server program requires a servlet container. It happens to come with one in its example setup - Jetty, but that's not the only one, and probably not even the most popular. Tomcat is already heavily used for other things, and a lot of people use what is familiar. My setup uses the included Jetty, but my overall setup is highly customized. I've written my own init script that only works for my install, because the way I did things will not work for everyone. One size does not fit all.

Writing an install/upgrade script that would work for other people would be a monumental task, so in the rest of what I am saying, I will assume that you are just writing this for you, and start with the standard Solr answer that usually applies to any question: It depends.

Upgrading Solr itself basically will amount to these steps, assuming your container doesn't have a way to automate it:
1) Stop the container (Jetty, Tomcat, etc.).
2) Erase all the data extracted from the previous solr.war file.
 2.a) For the example Jetty, this happens in the "work" directory.
3) Overwrite the solr.war file with the new one.
4) Update any associated jars in included lib folders.
5) Start the container.

Step 4 makes it particularly hard to script. Not impossible, but there are a lot of possible jars and filenames, which can vary from version to version.

When it comes to config files, I would recommend against having your script do anything here. The chances of the example schema.xml, solrconfig.xml, and other config files (as a set) being useful for any production setup is pretty much zero. If you are upgrading minor versions (3.4 to 3.5, for example), chances are good that your config will work with absolutely no changes. That said, your setup probably will benefit from some minor changes relating to improvements or changes since your previous version. If you are upgrading major versions, you may want to start over from scratch and make new config files to get the most benefit.

Unless you are truly a scripting wizard and you've had WAY too many redbulls, your script will not be able to modify your config for an upgrade, and you'd have to have a custom script for each version. Except when I upgraded from 1.4 to 3.2, the new Solr has worked with my previous config, but I've always gotten some benefit from minor config changes, and I've had to do some research to find out what those changes are.

Thanks,
Shawn

Reply via email to