How to Migrate Elasticsearch Databases to DigitalOcean OpenSearch
Validated on 27 Jan 2026 • Last edited on 29 Jan 2026
OpenSearch is an open-source search and analytics suite which serves as a centralized location to manage logs forwarded from other resources, such as databases and Droplets.
While DigitalOcean OpenSearch does not currently support online migration, you can reindex data from a remote Elasticsearch cluster to migrate it to an OpenSearch cluster.
Allowlist Elasticsearch
Add the Elasticsearch cluster to your OpenSearch cluster’s allowlist by adding the reindex.remote.whitelist parameter, pointing to your Elasticsearch cluster in host:port format.
Export Index Mapping
From your Elasticsearch cluster, stop writes to each index you want to migrate.
Then, use the following curl command to export the index mapping from the source Elasticsearch instance into a file named mapping.json, which the migration process uses as a reference:
curl https://username:password@tutorial-opensearch-do-user-10312437-0.i.db.ondigitalocean.com:25060/logs-2026-01-27/_mapping > mapping.jsonUpdate mapping.json to the format necessary for migration by running the following jq command:
jq .[].mappings mapping.json > src_mapping.jsonAlternatively, you can update mapping.json manually by editing it using the text editor of your choice and changing the following:
- Remove the wrapping
{"logs-2026-01-27":{"mappings": ... }} - Keep
{"properties":...}}
Reindex
Then, create an empty index on your destination OpenSearch cluster, such as by using the following curl command:
curl -XPUT https://username:password@tutorial-opensearch-do-user-10312437-0.i.db.ondigitalocean.com:25060/logs-2026-01-27Import the mapping to the destination OpenSearch index:
curl -XPUT https://username:password@tutorial-opensearch-do-user-10312437-0.i.db.ondigitalocean.com:25060/logs-2026-01-27/_mapping \
-H 'Content-type: application/json' -T src_mapping.jsonAnd submit the reindexing request to finalize the migration:
curl -XPOST https://username:password@tutorial-opensearch-do-user-10312437-0.i.db.ondigitalocean.com:25060/_reindex \
-H 'Content-type: application/json' \
-d '{"source":
{"index": "logs-2026-01-27",
"remote":
{"username": "your-remote-username",
"password": "your-remote-password",
"host": "https://tutorial-opensearch-do-user-10312437-0.i.db.ondigitalocean.com:25060:25070"
}
},
"dest":
{"index": "logs-2026-01-27"}
}'Once the reindexing process is complete, update your clients to use the new index on your DigitalOcean OpenSearch cluster and resume any paused writing activity.