TPS
TPS

Reputation: 518

Rename Apache Solr Collection or something like that

I know we cannot directly rename any solr collection. We can just create an alias that points to the collection. But we have the requirement to rename the collection. Is there any way to achieve the following in solrcloud? (version: apache-solr version 8.4.1)

  1. We have a main_collection (Which is we are currently using)
  2. We have second collection temp_collection (Which we are planning to move)
  3. we cannot migrate both
  4. We have so many applications that are hardcoded to use main_collection
  5. We have huge number of indexes in temp_collection.

Our idea initially was to rename the main_collection to backup_collection and then rename temp_collection to main_collection.

Is there any way to achieve the same. So that we cannot experience any downtime with the applications.

Upvotes: 1

Views: 2362

Answers (1)

Abhijit Bashetti
Abhijit Bashetti

Reputation: 8668

You can try these steps.

  1. Index your data in new collection.
  2. Once all the data is indexed,create an alias to new collection. Give the alias name same as the old collection.
  3. All your new request will be redirected to new collection.
  4. Once everything is set you can delete the old collection.

Here you can find all the collection apis listed. Collection APIs

Upvotes: 1

Related Questions