solrbackupsolrconfig

how to backup solrconfig file from running solr


I have a single core solr server. when solr was running, in one collection solrconfig.xml and schema.xml files replaced by mistake. now collection worked correctly and correctly response to request but valid file in conf folder is replaced by mistake files. surly if i reload collection, new bad files load and my collection not worked correctly.

is there a way than can get solrconfig.xml & schema.xml from running collection without considering solrconfig.xml and schema.xml files that exist in conf folder?


Solution

  • You can read the current running schema and config through the Solr schema API and Solr config API.

    Pay attention: the results of this APIs is not the original schema.xml or solrconfig.xml files but from that you can rebuild the originals.

    Again, pay also attention that Solr config API is available only in recent version of Solr.

    In older versions (I have tested version 4.8.1) are no API for the solr configuration, so there is no way to fully rebuild the solrconfig.xml file.