Backup Infra Solr collections

Backup the Infra solr collections from the Ambari managed Infra Solr service and restore them on the Infra Solr service managed by Cloudera Manager. When you are creating a backup of the Infra solr data, ensure that only Infra Solr and Zookeeper services are started and other services are stopped. Similarly, when you are restoring the data on Infra Solr managed by Cloudera Manager, you must start HDFS and Zookeeper only. This ensures no operations are performed by services which can push data to Infra Solr.

To create a backup of the Infra solr collections from Infra Solr service, perform the following steps:
  1. The assumption is /opt/solrdata is the work directory which must pre-exist on both local file system and HDFS.
    mkdir -p /opt/solrdata/
    kinit -kt hdfs.keytab hdfs; hdfs dfs -mkdir -p /opt/solrdata
  2. Set the path for the ini configuration file.
    CONFIG_INI_LOCATION=/opt/solrdata/ambari_solr_migration.ini
  3. For the backup of data from Infra Solr to HDFS:
    1. Generate the ini configuration file which is used by the migration helper.
      /usr/bin/python /usr/lib/ambari-infra-solr-client/migrationConfigGenerator.py --ini-file $CONFIG_INI_LOCATION --host <Ambari Server Host> --port <Ambari Server Port> --cluster <Cluster-Name> --username <Ambari admin username> --password <Ambari admin password> --backup-base-path=/opt/solrdata --hdfs-base-path=/opt/solrdata --java-home <JAVA JDK HOME which is also used by Ambari > -s < use -s if TLS is enabled for Ambari>
    2. Backup collections:
      /usr/lib/ambari-infra-solr-client/migrationHelper.py --ini-file $CONFIG_INI_LOCATION --action backup
    3. Copy the backup to HDFS:
      /usr/lib/ambari-infra-solr-client/migrationHelper.py --ini-file $CONFIG_INI_LOCATION --action copy-to-hdfs
      You can now use the AM2CM tool to migrate from the Ambari-managed HDP cluster to the Cloudera Manager-managed CDP cluster.