Skip to content

This Makefile provides automation for migrating data from one Elasticsearch index to another using the elasticdump tool. It allows you to define source and destination index mappings and manage the migration process easily.

Notifications You must be signed in to change notification settings

zakyyudha/elastic-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elasticsearch Migration

This Makefile provides automation for migrating data from one Elasticsearch index to another using the elasticdump tool. It allows you to define source and destination index mappings and manage the migration process easily.

Prerequisites

Before using this Makefile, ensure you have the following prerequisites installed:

Configuration

  1. Create a .env file in the same directory as the Makefile with the following format:
# Define mappings of source and destination indices
## <INDEX_SOURCE>:<INDEX_DEST>
## Example:
## tds_customer_complex_telkom_product:es-ewz-tds-customer_complex_telkom_product
INDEX_MAP=\
    index1:dest_index1 \
    index2:dest_index2 \
    index3:dest_index3

# Define reindex of source and destination indices
## <INDEX_SOURCE>:<INDEX_DEST>
## Example:
## es-ewz-tds-catalog_classification:cs-ewz-tds-catalog_classification
REINDEX_INDICES=\
    index1:dest_index1 \
    index2:dest_index2 \
    index3:dest_index3

# Specify the source and destination Elasticsearch hosts
SOURCE_HOST=http://production.es.com:9200
DEST_HOST=http://staging.es.com:9200

Modify the INDEX_MAP, SOURCE_HOST, and DEST_HOST variables according to your specific Elasticsearch setup.

Usage

  • To start Elasticsearch migration for all specified indices:

    make migrate
  • To start Elasticsearch migration for a single index (not recommended for typical use):

    make migrate-index INDEX_SOURCE=<source_index> INDEX_DEST=<dest_index>
  • To kill a specific migration process based on the destination index:

    make kill INDEX_DEST=<your_index_dest>
  • To terminate all migration processes:

    make kill-all

About

This Makefile provides automation for migrating data from one Elasticsearch index to another using the elasticdump tool. It allows you to define source and destination index mappings and manage the migration process easily.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published