public static void replicateIndex(String destHostName,String destCore,String sourceHost,String sourceCore) throws Exception {
  String fullReplication="http://%s:%s/solr/%s/replication?command=fetchindex&masterUrl=http://%s:%s/solr/%s";
  String replicator=String.format(fullReplication,destHostName,DEFAULT_SOLR_PORT,destCore,sourceHost,DEFAULT_SOLR_PORT,sourceCore);
  String result=executeSolrCommand(replicator);
  logger.info(result);
}

public static void replicateIndex ( String destHostName , String destCore , String sourceHost , String sourceCore ) throws Exception { String fullReplication = "http://%s:%s/solr/%s/replication?command=fetchindex&masterUrl=http://%s:%s/solr/%s" ; String replicator = String . format ( fullReplication , destHostName , DEFAULT_SOLR_PORT , destCore , sourceHost , DEFAULT_SOLR_PORT , sourceCore ) ; String result = executeSolrCommand ( replicator ) ; logger . info ( result ) ; }
given a source core , destination core and hosts , replicate index from source to destination
