Little known trick:

The fetchIndex replication API call can take any parameter you specify
in your config. So you don't have to configure replication at all on
your target collection, just issue the replication API command with
masterUrl, something like:

http://solr_target_machine:port/solr/core/replication?command=fetchindex&masterUrl=http://solr_source_machine:port/solr/core

NOTE, "core" above will be something like collection1_shard1_replica1....

During the fetchindex, you won't be able to search on the target
collection although the source will be searchable.

Now, all that said this is just copying stuff. So let's say you've
indexed to your source cluster and set up your target cluster (but
don't index anything to the target or do the replication etc). Now if
you shut down the target cluster and just copy the entire data dir
from each source replica to each target replica then start all the
target Solr instances up you'll be fine.

Best,
Erick

On Thu, Oct 19, 2017 at 1:33 PM, Hendrik Haddorp
<hendrik.hadd...@gmx.net> wrote:
> Hi,
>
> I want to transfer a Solr collection from one SolrCloud to another one. For
> that I create a collection in the target cloud using the same config set as
> on the source cloud but with a replication factor of one. After that I'm
> using the Solr core API with a "replication?command=fetchindex" command to
> transfer the data. In the last step I'm increasing the replication factor.
> This seems to work fine so far. When I invoke "replication?command=details"
> I can see my replication setup and check if the replication is done. In the
> end I would like to remove this relation again but there does not seem to be
> an API call for that. Given that the replication should be a one time
> replication according to the API on
> https://lucene.apache.org/solr/guide/6_6/index-replication.html this should
> not be a big problem. It just does not look clean to me to leave this in the
> system. Is there anything I'm missing?
>
> regards,
> Hendrik

Reply via email to