Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Tutorials
    • All tutorials
    • Deploying the Apache Kafka® web interface
    • Migrating a database from a third-party Apache Kafka® cluster to Managed Service for Apache Kafka®
    • Moving data between Managed Service for Apache Kafka® clusters using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for YDB to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for Greenplum® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MongoDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for OpenSearch using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for YDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Data Streams using Data Transfer
    • Delivering data from Data Streams to Managed Service for YDB using Data Transfer
    • Delivering data from Data Streams to Managed Service for Apache Kafka® using Data Transfer
    • YDB change data capture and delivery to YDS
    • Configuring Kafka Connect to work with a Managed Service for Apache Kafka® cluster
    • Automating Query tasks with Managed Service for Apache Airflow™
    • Sending requests to the Yandex Cloud API via the Yandex Cloud Python SDK
    • Configuring an SMTP server to send e-mail notifications
    • Adding data to a ClickHouse® DB
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for ClickHouse® using Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Exchanging data between Managed Service for ClickHouse® and Yandex Data Processing
    • Configuring Managed Service for ClickHouse® for Graphite
    • Fetching data from Managed Service for Apache Kafka® to Managed Service for ClickHouse®
    • Fetching data from Managed Service for Apache Kafka® to ksqlDB
    • Fetching data from RabbitMQ to Managed Service for ClickHouse®
    • Saving a Data Streams data stream in Managed Service for ClickHouse®
    • Asynchronous replication of data from Yandex Metrica to ClickHouse® using Data Transfer
    • Using hybrid storage in Managed Service for ClickHouse®
    • Sharding Managed Service for ClickHouse® tables
    • Data resharding in a Managed Service for ClickHouse® cluster
    • Loading data from Yandex Direct to a data mart enabled by Managed Service for ClickHouse® using Cloud Functions, Object Storage, and Data Transfer
    • Loading data from Object Storage to Managed Service for ClickHouse® using Data Transfer
    • Migrating data with change of storage from Managed Service for OpenSearch to Managed Service for ClickHouse® using Data Transfer
    • Loading data from Managed Service for YDB to Managed Service for ClickHouse® using Data Transfer
    • Migrating databases from Google BigQuery to Managed Service for ClickHouse®
    • Configuring Cloud DNS to access a Managed Service for ClickHouse® cluster from other cloud networks
    • Migrating a Yandex Data Processing HDFS cluster to a different availability zone
    • Importing data from Managed Service for MySQL® to Yandex Data Processing using Sqoop
    • Importing data from Managed Service for PostgreSQL to Yandex Data Processing using Sqoop
    • Mounting Object Storage buckets to the file system of Yandex Data Processing hosts
    • Working with Apache Kafka® topics using Yandex Data Processing
    • Automating operations with Yandex Data Processing using Managed Service for Apache Airflow™
    • Shared use of Yandex Data Processing tables through Metastore
    • Transferring metadata between Yandex Data Processing clusters using Metastore
    • Importing data from Object Storage, processing and exporting to Managed Service for ClickHouse®
    • Migrating to Managed Service for Elasticsearch using snapshots
    • Migrating collections from a third-party MongoDB cluster to Managed Service for MongoDB
    • Migrating data to Managed Service for MongoDB
    • Migrating Managed Service for MongoDB cluster from 4.4 to 6.0
    • Sharding MongoDB collections
    • MongoDB performance analysis and tuning
    • Migrating a database from a third-party MySQL® cluster to a Managed Service for MySQL® cluster
    • Managed Service for MySQL® performance analysis and tuning
    • Syncing data from a third-party MySQL® cluster to Managed Service for MySQL® using Data Transfer
    • Migrating a database from Managed Service for MySQL® to a third-party MySQL® cluster
    • Migrating a database from Managed Service for MySQL® to Object Storage using Data Transfer
    • Migrating data from Object Storage to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Migrating a database from Managed Service for MySQL® to Managed Service for YDB using Data Transfer
    • MySQL® change data capture and delivery to YDS
    • Migrating data from Managed Service for MySQL® to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from AWS RDS for PostgreSQL to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from Managed Service for MySQL® to Managed Service for Greenplum® using Data Transfer
    • Configuring an index policy in Managed Service for OpenSearch
    • Migrating data from Elasticsearch to Managed Service for OpenSearch
    • Migrating data from a third-party OpenSearch cluster to Managed Service for OpenSearch using Data Transfer
    • Loading data from Managed Service for OpenSearch to Object Storage using Data Transfer
    • Migrating data from Managed Service for OpenSearch to Managed Service for YDB using Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for Greenplum® using Yandex Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Authenticating a Managed Service for OpenSearch cluster in OpenSearch Dashboards using Keycloak
    • Using the yandex-lemmer plugin in Managed Service for OpenSearch
    • Creating a PostgreSQL cluster for 1C:Enterprise
    • Searching for the Managed Service for PostgreSQL cluster performance issues
    • Managed Service for PostgreSQL performance analysis and tuning
    • Logical replication PostgreSQL
    • Migrating a database from a third-party PostgreSQL cluster to Managed Service for PostgreSQL
    • Migrating a database from Managed Service for PostgreSQL
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for YDB using Data Transfer
    • Migrating a database from Managed Service for PostgreSQL to Object Storage
    • Migrating data from Object Storage to Managed Service for PostgreSQL using Data Transfer
    • PostgreSQL change data capture and delivery to YDS
    • Migrating data from Managed Service for PostgreSQL to Managed Service for MySQL® using Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Troubleshooting string sorting issues in PostgreSQL after upgrading glibc
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from Greenplum® to PostgreSQL
    • Exporting Greenplum® data to a cold storage in Object Storage
    • Loading data from Object Storage to Managed Service for Greenplum® using Data Transfer
    • Copying data from Managed Service for OpenSearch to Managed Service for Greenplum® using Yandex Data Transfer
    • Creating an external table from a Object Storage bucket table using a configuration file
    • Migrating a database from a third-party Valkey™ cluster to Yandex Managed Service for Valkey™
    • Using a Yandex Managed Service for Valkey™ cluster as a PHP session storage
    • Loading data from Object Storage to Managed Service for YDB using Data Transfer
    • Loading data from Managed Service for YDB to Object Storage using Data Transfer
    • Processing Audit Trails events
    • Processing Cloud Logging logs
    • Processing CDC Debezium streams
    • Analyzing data with Jupyter
    • Processing files with usage details in Yandex Cloud Billing
    • Entering data into storage systems
    • Smart log processing
    • Transferring data within microservice architectures
    • Migrating data to Object Storage using Data Transfer
    • Migrating data from a third-party Greenplum® or PostgreSQL cluster to Managed Service for Greenplum® using Data Transfer
    • Migrating Managed Service for MongoDB clusters
    • Migrating MySQL® clusters
    • Migrating to a third-party MySQL® cluster
    • Migrating PostgreSQL clusters
    • Creating a schema registry to deliver data in Debezium CDC format from Apache Kafka®

In this article:

  • Required paid resources
  • Migration using snapshots
  • Getting started
  • Create a snapshot on the source cluster
  • Restore a snapshot on the target cluster
  • Complete your migration
  • Delete the resources you created
  • Migration using reindexing
  • Getting started
  • Configure the target cluster
  • Start reindexing
  • Check the result
  • Delete the resources you created
  1. Building a data platform
  2. Migrating data from Elasticsearch to Managed Service for OpenSearch

Migrating databases from Elasticsearch to Yandex Managed Service for OpenSearch

Written by
Yandex Cloud
Updated at May 7, 2025
  • Required paid resources
  • Migration using snapshots
    • Getting started
    • Create a snapshot on the source cluster
    • Restore a snapshot on the target cluster
    • Complete your migration
    • Delete the resources you created
  • Migration using reindexing
    • Getting started
    • Configure the target cluster
    • Start reindexing
    • Check the result
    • Delete the resources you created

Note

Yandex Managed Service for Elasticsearch is unavailable starting April 11, 2024.

There are three ways to migrate data from a source Elasticsearch cluster to a target Yandex Managed Service for OpenSearch cluster:

  • Yandex Data Transfer

    This method is good for any Elasticsearch cluster.

    For an example of this migration type, see Migrating data to OpenSearch using Yandex Data Transfer.

  • Snapshots

    This method is good for Elasticsearch cluster versions 7.11 or lower.

    For more information about snapshots, see the OpenSearch documentation.

  • Remote reindexing (reindex data).

    You can use this method to move your existing indexes, aliases, or data streams. This method is good for all version 7 Elasticsearch clusters.

Required paid resourcesRequired paid resources

The support cost includes:

  • Managed Service for OpenSearch cluster fee: Using computing resources allocated to hosts (including hosts with the MANAGER role) and disk space (see OpenSearch pricing).
  • Fee for public IP addresses for cluster hosts (see Virtual Private Cloud pricing).
  • Object Storage bucket fee: Storing data and performing operations with it (see Object Storage pricing).

Migration using snapshotsMigration using snapshots

To migrate data from a source Elasticsearch cluster to a target Managed Service for OpenSearch cluster using snapshots:

  1. Create a snapshot in the source cluster.
  2. Restore the snapshot in the target cluster.
  3. Complete your migration.

If you no longer need the resources you are using, delete them.

Getting startedGetting started

Set up your infrastructureSet up your infrastructure

Manually
Using Terraform
  1. Create an Object Storage bucket with restricted access. This bucket will serve as a snapshot repository.

  2. Create a service account and assign it the storage.editor role. A service account is required to access the bucket from the source and target clusters.

  3. If you are transferring data from a third-party Elasticsearch cluster, create a static access key for this service account.

    Warning

    Save the key ID and secret key. You will need these at the next steps.

  4. Create a target Managed Service for OpenSearch cluster in your desired configuration with the following settings:

    • Plugin: repository-s3.
    • Public access to a group of DATA hosts.
  1. If you do not have Terraform yet, install it.

  2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

  3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

  4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

  5. Download the es-mos-migration-snapshot.tf configuration file to the same working directory. This file describes:

    • Network.
    • Subnet.
    • Security group and rules required to connect to a Managed Service for OpenSearch cluster.
    • Service account for working with the Object Storage bucket.
    • Object Storage bucket.
    • Target Managed Service for OpenSearch cluster.
  6. In the es-mos-migration-snapshot.tf file, specify these variables:

    • folder_id: Cloud folder ID, same as in the provider settings.
    • bucket_name: Bucket name consistent with the naming conventions.
    • os_admin_password: OpenSearch admin password.
    • os_version: OpenSearch version.
  7. Make sure the Terraform configuration files are correct using this command:

    terraform validate
    

    If there are any errors in the configuration files, Terraform will point them out.

  8. Create the required infrastructure:

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

Complete the configuration and check access to the resourcesComplete the configuration and check access to the resources

  1. Set up the bucket ACL:

    1. In the Select a user drop-down list, specify the created service account.
    2. Select the READ and WRITE permissions for the selected service account.
    3. Click Add.
    4. Click Save.
  2. Set up the source Elasticsearch cluster:

    1. Install the plugin repository-s3 on all cluster hosts.

    2. For the repository-s3 plugin to work, restart the Elasticsearch and Kibana services on all cluster hosts.

    3. Make sure the Elasticsearch source cluster can access the internet.

  3. Install an SSL certificate.

  4. Make sure you can connect to the target Managed Service for OpenSearch cluster using the OpenSearch API and Dashboards.

Create a snapshot on the source clusterCreate a snapshot on the source cluster

  1. Connect the bucket as a snapshot repository on the source cluster:

    1. Add the static access key information to the Elasticsearch keystore (keystore).

      Note

      Run the procedure on all hosts of the source cluster.

      Add the following:

      • Key ID:

        $ES_PATH/bin/elasticsearch-keystore add s3.client.default.access_key
        
      • Secret key:

        $ES_PATH/bin/elasticsearch-keystore add s3.client.default.secret_key
        

      Note

      The path to Elasticsearch ($ES_PATH) depends on the selected installation method. To find a path to your Elasticsearch installation, see the installation documentation (for example, for DEB, RPM).

    2. Upload the data from the keystore:

      curl --request POST "https://<IP_or_FQDN_of_source_cluster_DATA_host>:9200/_nodes/reload_secure_settings"
      
    3. Register the repository:

      curl --request PUT \
           "https://<IP_or_FQDN_of_source_cluster_DATA_host>:9200/_snapshot/<repository_name>" \
           --header 'Content-Type: application/json' \
           --data '{
             "type": "s3",
             "settings": {
               "bucket": "<bucket_name>",
               "endpoint": "storage.yandexcloud.net"
             }
           }'
      

    To learn more about connecting the repository, see the Elastic plugin documentation.

    Alert

    If a bucket is registered in an Elasticsearch cluster as a snapshot repository, do not edit the bucket contents manually as this will disrupt the Elasticsearch snapshot mechanism.

  2. Run snapshot creation in the repository you created at the previous step. You can create a snapshot of the entire cluster or some of the data. For more information, see this Elasticsearch guide on snapshots.

    Example of creating a snapshot named snapshot_1 for the entire cluster:

    curl --request PUT \
         "https://<IP_or_FQDN_of_the_DATA_host_in_the_source_cluster>:9200/_snapshot/<repository_name>/snapshot_1?wait_for_completion=false&pretty"
    

    Creating a snapshot may take a while. Track the operation progress using Elasticsearch tools, such as:

    curl --request GET \
         "https://<IP_or_FQDN_of_the_DATA_host_in_the_source_cluster>:9200/_snapshot/<repository_name>/snapshot_1/_status?pretty"
    

Restore a snapshot on the target clusterRestore a snapshot on the target cluster

  1. Configure access to the bucket with snapshots for the target cluster. Use the service account you created earlier.

  2. Attach an Object Storage bucket to the target cluster. This bucket will serve as a read-only snapshot storage:

    curl --request PUT \
         "https://admin:<admin_user_password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>" \
         --cacert ~/.opensearch/root.crt \
         --header 'Content-Type: application/json' \
         --data '{
           "type": "s3",
           "settings": {
             "bucket": "<bucket_name>",
             "readonly" : "true",
             "endpoint": "storage.yandexcloud.net"
           }
         }'
    
  3. Select the index restoration method on the target cluster.

    With the default settings, an attempt to restore an index will fail in a cluster where a same-name index is already open. Even in Managed Service for OpenSearch clusters without user data, there are open system indexes (such as .apm-custom-link or .kibana_*, etc.), which may interfere with the restore operation. To avoid this, use one of the following methods:

    • Migrate only your custom indexes. The existing system indexes are not migrated. The import process only affects the user-created indexes on the source cluster.

    • Use the rename_pattern and rename_replacement parameters. Indexes will be renamed as they are restored. For more information, see the relevant OpenSearch documentation.

    Example of restoring the entire snapshot:

    curl --request POST \
         "https://admin:<admin_user_password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>/snapshot_1/_restore" \
         --cacert ~/.opensearch/root.crt
    
  4. Start restoring data from the snapshot on the target cluster.

    Example of restoring a snapshot with indication of the custom indexes to restore on the target cluster:

    curl --request POST \
         "https://admin:<admin_user_password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>/snapshot_1/_restore?wait_for_completion=false&pretty" \
         --cacert ~/.opensearch/root.crt \
         --header 'Content-Type: application/json' \
         --data '{
           "indices": "<list_of_indexes>"
         }'
    

    Where indices is a list of comma-separated indexes to restore, e.g., my_index*, my_index_2.*.

    Restoring a snapshot may take a while. To check the restoring status, run this command:

    curl --request GET \
         "https://admin:<admin_user_password>@<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_snapshot/<repository_name>/snapshot_1/_status?pretty" \
         --cacert ~/.opensearch/root.crt
    

Complete your migrationComplete your migration

  1. Make sure all indexes have been transferred to the target Managed Service for OpenSearch cluster and the number of documents in them is the same as in the source cluster:

    Bash
    OpenSearch Dashboards

    Run this command:

    curl \
        --user <username_in_target_cluster>:<user_password_in_target_cluster> \
        --cacert ~/.opensearch/root.crt \
        --request GET 'https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_cat/indices?v'
    

    The list should contain the indexes transferred from Elasticsearch with the number of documents specified in the docs.count column.

    1. Connect to the target cluster using OpenSearch Dashboards.
    2. Select the Global tenant.
    3. Open the control panel by clicking .
    4. Under OpenSearch Plugins, select Index Management.
    5. Go to Indexes.

    The list should contain the indexes transferred from Elasticsearch with the number of documents specified in the Total documents column.

  2. If required, disable the snapshot repository on the source and target cluster end.

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. To avoid paying for them, delete the resources you no longer need:

Manually
Using Terraform
  • Delete the service account.
  • Delete the snapshots from the bucket and then, the entire bucket.
  • Delete the Managed Service for OpenSearch cluster.
  1. Delete all objects from the bucket.
  1. In the terminal window, go to the directory containing the infrastructure plan.

    Warning

    Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

  2. Delete resources:

    1. Run this command:

      terraform destroy
      
    2. Confirm deleting the resources and wait for the operation to complete.

    All the resources described in the Terraform manifests will be deleted.

Migration using reindexingMigration using reindexing

To migrate data from a source Elasticsearch cluster to a target Managed Service for OpenSearch cluster by reindexing:

  1. Configure the target cluster.
  2. Start reindexing.
  3. Check the result.

If you no longer need the resources you created, delete them.

Getting startedGetting started

  1. Set up your infrastructure:

    Manually
    Using Terraform

    Create a target Managed Service for OpenSearch cluster in your desired configuration with public access to a group of hosts with the DATA role.

    1. If you do not have Terraform yet, install it.

    2. Get the authentication credentials. You can add them to environment variables or specify them later in the provider configuration file.

    3. Configure and initialize a provider. There is no need to create a provider configuration file manually, you can download it.

    4. Place the configuration file in a separate working directory and specify the parameter values. If you did not add the authentication credentials to environment variables, specify them in the configuration file.

    5. Download the es-mos-migration-reindex.tf configuration file to the same working directory. This file describes:

      • Network.
      • Subnet.
      • Security group and rules required to connect to a Managed Service for OpenSearch cluster.
      • Target Managed Service for OpenSearch cluster.
    6. In the es-mos-migration-reindex.tf file, specify these variables:

      • os_admin_password: OpenSearch admin password.
      • os_version: OpenSearch version.
    7. Make sure the Terraform configuration files are correct using this command:

      terraform validate
      

      If there are any errors in the configuration files, Terraform will point them out.

    8. Create the required infrastructure:

      1. Run this command to view the planned changes:

        terraform plan
        

        If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

      2. If everything looks correct, apply the changes:

        1. Run this command:

          terraform apply
          
        2. Confirm updating the resources.

        3. Wait for the operation to complete.

      All the required resources will be created in the specified folder. You can check resource availability and their settings in the management console.

  2. Install an SSL certificate:

    Linux (Bash)/macOS (Zsh)
    Windows (PowerShell)
    mkdir -p ~/.opensearch && \
    wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" \
         --output-document ~/.opensearch/root.crt && \
    chmod 0600 ~/.opensearch/root.crt
    

    The certificate will be saved to the ~/.opensearch/root.crt file.

    mkdir $HOME\.opensearch; curl.exe -o $HOME\.opensearch\root.crt https://storage.yandexcloud.net/cloud-certs/CA.pem
    

    The certificate will be saved to the $HOME\.opensearch\root.crt file.

    Corporate policies and antivirus software can block the download of certificates. For more information, see FAQ.

  3. Make sure you can connect to the target Managed Service for OpenSearch cluster using the OpenSearch API and Dashboards.

  4. Make sure the Elasticsearch source cluster can access the internet.

  5. Create a user with the monitoring_user and viewer roles in the target cluster.

Configure the target clusterConfigure the target cluster

  1. Create a role with the create_index and write privileges for all indexes (*).

  2. Create a user and assign this role to them.

    Tip

    In Managed Service for OpenSearch clusters, you can run re-indexing as the admin user with the superuser role; however, a more secure strategy is to create dedicated users with limited privileges for each job. For more information, see Managing OpenSearch users.

Start reindexingStart reindexing

  1. Retrieve the list of hosts in the target cluster.

  2. To start reindexing, run a request to the host with the DATA role in the target cluster:

    curl --user <username_in_target_cluster>:<user_password_in_target_cluster> \
         --cacert ~/.opensearch/root.crt \
         --request POST \
         "https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_reindex?wait_for_completion=false&pretty" \
         --header 'Content-Type: application/json' \
         --data '{
           "source": {
             "remote": {
               "host": "https://<IP_address_or_FQDN_of_host_with_DATA_role_in_source_cluster>:9200",
               "username": "<username_in_source_cluster>",
               "password": "<user_password_in_source_cluster>"
             },
             "index": "<name_of_index_alias_or_data_stream_in_source_cluster>"
           },
           "dest": {
             "index": "<name_of_index_alias_or_data_stream_in_target_cluster>"
           }
         }'
    

    Result:

    {
      "task" : "<ID_of_reindexing_job>"
    }
    

    To transfer several indexes, use a for loop:

    for index in <names_of_indexes_of_aliases_or_data_streams_separated_by_spaces>; do
      curl --user <username_in_target_cluster>:<user_password_in_target_cluster> \
           --cacert ~/.opensearch/root.crt \
           --request POST \
           "https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_reindex?wait_for_completion=false&pretty" \
           --header 'Content-Type: application/json' \
           --data '{
             "source": {
               "remote": {
                 "host": "https://<IP_address_or_FQDN_of_host_with_DATA_role_in_source_cluster>:9200",
                 "username": "<username_in_source_cluster>",
                 "password": "<user_password_in_source_cluster>"
               },
               "index": "'$index'"
             },
             "dest": {
               "index": "'$index'"
             }
           }'
    done
    

    Result:

    {
      "task" : "<ID_of_reindexing_job_1>"
    }
    {
      "task" : "<ID_of_reindexing_job_2>"
    }
    ...
    

    To learn more about reindexing parameters, see the OpenSearch documentation.

    Reindexing may take a while. To check the operation status, run this command:

    curl --user <username_in_target_cluster>:<user_password_in_target_cluster> \
         --cacert ~/.opensearch/root.crt \
         --request GET \
         "https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_tasks/<ID_of_reindexing_job>"
    
  3. To cancel reindexing, run this command:

    curl --user <username_in_target_cluster>:<user_password_in_target_cluster> \
         --cacert ~/.opensearch/root.crt \
         --request POST \
         "https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_tasks/<reindexing_job_ID>/_cancel"
    

Check the resultCheck the result

Make sure all indexes have been transferred to the target Managed Service for OpenSearch cluster and the number of documents in them is the same as in the source cluster:

Bash
OpenSearch Dashboards

Run this command:

curl \
    --user <username_in_target_cluster>:<user_password_in_target_cluster> \
    --cacert ~/.opensearch/root.crt \
    --request GET 'https://<ID_of_OpenSearch_host_with_DATA_role>.mdb.yandexcloud.net:9200/_cat/indices?v'

The list should contain the indexes transferred from Elasticsearch with the number of documents specified in the docs.count column.

  1. Connect to the target cluster using OpenSearch Dashboards.
  2. Select the Global tenant.
  3. Open the control panel by clicking .
  4. Under OpenSearch Plugins, select Index Management.
  5. Go to Indexes.

The list should contain the indexes transferred from Elasticsearch with the number of documents specified in the Total documents column.

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. To avoid paying for them, delete the resources you no longer need:

  • Delete the objects from the bucket.

  • Delete the resources depending on how you created them:

    Manually
    Using Terraform

    Delete the Managed Service for OpenSearch cluster.

    1. In the terminal window, go to the directory containing the infrastructure plan.

      Warning

      Make sure the directory has no Terraform manifests with the resources you want to keep. Terraform deletes all resources that were created using the manifests in the current directory.

    2. Delete resources:

      1. Run this command:

        terraform destroy
        
      2. Confirm deleting the resources and wait for the operation to complete.

      All the resources described in the Terraform manifests will be deleted.

  • If you reserved public static IPs for cluster access, release and delete them.

Was the article helpful?

Previous
Configuring an index policy in Managed Service for OpenSearch
Next
Migrating data from a third-party OpenSearch cluster to Managed Service for OpenSearch using Data Transfer
Yandex project
© 2025 Yandex.Cloud LLC