Search code examples
apachesolrlucenesolrjbigdata

Upgrade an Apache Solr index from 1.x to 5.x (or later versions)


I am migrating from solr 1.0 to 5.3.0. I have copied all data directories to newer core data directories but i am getting the follwoing exception on starting :

org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/Resume/resume/data/index/segments_1a9"))): -9 
(needs to be between 1071082519 and 1071082519). This version of Lucene only supports indexes created with release 4.0 and later.

Can any one tell to the detail process to to covert solr 1.x index data to 4.0?


Solution

  • You can only move from version 1 to version 3 in one go.

    You should use the IndexUpgrader tool for the version of Solr that you are using

    e.g for 3.0

    java -cp lucene-core.jar org.apache.lucene.index.IndexUpgrader [-delete-prior-commits] [-verbose] indexDir
    

    You may need to upgrade via intermediate versions. Ie. upgrade to 3.0 then to 4.0 then 5.0. You could script this.

    https://cwiki.apache.org/confluence/display/solr/IndexUpgrader+Tool

    You need to do this on a cold index. You'll find lucene-core.jar in your Solr install directory.