Search code examples
indexingsolrlucenesolrcloudindexer

What's the recommended approach to upgrading Solr from version 7.7.3 to 9.1.1 using the IndexUpgrader tool?


We are trying to upgrade solr version 7.7.3 to 9.1.1; for this do we have to run IndexUpgrader Tool before upgrading to next major version(i.e 7x to 8x) or after upgrading to 8x, we have to run this 7x utility to reindex the documents?


Solution

  • I have upgraded from 7.5 to 8.11 successfully. A direct upgreade from 7.x to 9.x may be risky as a lot has changed in 9.x. I would recommend upgrade from 7.x to 8.x and then from 8.x to 9.x. Please go through relevant Solr documentation here https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html

    So here are the general steps You need to upgrade Zookeeper and Solr a compatible version of your target Solr General steps

    Before Upgrade

    • Stop dependent application services
    • Shutdown all current Solr 7.x and Zookeeper services (or processes).
    • Note down the time of the upgrade start. This is important for rollback scenario. We will refer this time as upgrade_start_time
    • Take back up copy of Solr Data folder (which contain indexes)
    • Take back up copy of Zookeeper Data folder (containing zookeeper configs )

    Upgrade Solr - https://solr.apache.org/guide/8_11/upgrading-a-solr-cluster.html

    General steps

    • Start all existing Zookeeper nodes but keep Solr nodes stopped
    • Install Solr 8.11 as a service. Point to existing data directory while installing using the -d option. Use the -n option so that solr does not start up automatically after installation. Auto start might wipe out existing indexes
    • Ensure each solr node is connected to the existing Zookeeper ensemble
    • Update .in.sh with any specific customizations from previous installation (E.g. JVM properties)
    • Reindex using IndexUpgrader Tool provided by Solr
    • Start Solr nodes
    • Reload existing collections.

    At this time you should have an index properly upgraded to 8.11 You may want to separately upgrade Zookeeper too to a compatible version (3.6.x)

    Steps for Zookeeper upgrade

    Repeat the steps above for 8.x to 9.x, but do remember to draft your own run book after thorough reading of the links provided. As usual test this on dev environment before doing in production