def transfer_old_data()

in ambari-infra-solr-client/src/main/python/migrationHelper.py [0:0]


def transfer_old_data(options, accessor, parser, config):
  collections_json_location = COLLECTIONS_DATA_JSON_LOCATION.format("transport_collections.json")
  collections=list_collections(options, config, collections_json_location, include_number_of_docs=True)
  collections=filter_collections(options, collections)
  docs_map = get_number_of_docs_map(collections_json_location) if collections else {}
  if is_ranger_available(config, service_filter):
    original_ranger_collection = config.get('ranger_collection', 'ranger_collection_name')
    backup_ranger_collection = config.get('ranger_collection', 'backup_ranger_collection_name')
    run_solr_data_manager_on_collection(options, config, collections, backup_ranger_collection,
                                        original_ranger_collection, collections_json_location, docs_map, skip_date_usage=False)
  if is_atlas_available(config, service_filter):
    original_fulltext_index_name = config.get('atlas_collections', 'fulltext_index_name')
    backup_fulltext_index_name = config.get('atlas_collections', 'backup_fulltext_index_name')
    run_solr_data_manager_on_collection(options, config, collections, backup_fulltext_index_name,
                                        original_fulltext_index_name, collections_json_location, docs_map)

    original_edge_index_name = config.get('atlas_collections', 'edge_index_name')
    backup_edge_index_name = config.get('atlas_collections', 'backup_edge_index_name')
    run_solr_data_manager_on_collection(options, config, collections, backup_edge_index_name,
                                        original_edge_index_name, collections_json_location, docs_map)

    original_vertex_index_name = config.get('atlas_collections', 'vertex_index_name')
    backup_vertex_index_name = config.get('atlas_collections', 'backup_vertex_index_name')
    run_solr_data_manager_on_collection(options, config, collections, backup_vertex_index_name,
                                        original_vertex_index_name, collections_json_location, docs_map)