Migrating Elasticsearch
As of Informer 5.7.0, Elasticsearch 5 is no longer supported. Entrinsik provides a Migration Utility that copies data from a source Elasticsearch (version 5 or 7) to a new Elasticsearch 8, so Informer keeps running smoothly with the latest features. Informer 5.6.0 and later support Elasticsearch 8.
The migration runs both Elasticsearch instances at once, so the server needs enough memory and disk for both. See Elasticsearch 7 & 8 on Windows memory configuration.
Install Elasticsearch 8 on Windows
You install Elasticsearch 8 alongside the existing Elasticsearch 5 or 7 so the Migration Utility can copy data across.
-
Run the offline installer. On the Informer Components page, choose the Custom install type and select only Elasticsearch. This installs the bundled Elasticsearch 8 and sets its listening port to
9208. -
Make sure the server has enough memory to run both Elasticsearch instances at once (both are resource-intensive). See Elasticsearch 7 & 8 on Windows memory configuration.
-
Stop the Informer service.
-
In Informer's
config.json, point theelasticblock at Elasticsearch 8 (port9208, version8). Theversionline may be missing; it is required for Elasticsearch 8:"elastic": {"host": "localhost","port": 9208,"version": 8} -
Allow the two Elasticsearch servers to talk to each other. In the Elasticsearch 8
elasticsearch.yml(under...\elasticsearch\elasticsearch-8.X.X\config), set the remote whitelist. With the offline installer this comes preconfigured aslocalhost:*; otherwise add it:reindex.remote.whitelist: "localhost:*"Save the file, then stop and restart the Elasticsearch 8 service.
-
Start the Informer service, then run the Migration Utility (below). When the migration is complete, stop Informer, remove the
reindex.remote.whitelistproperty fromelasticsearch.yml, save, and restart Informer.
If the Informer Windows service has dependencies configured, update them to the new Elasticsearch 8 service name. In an Administrator Command Prompt (not PowerShell):
sc config entrinsikinformer5.exe depend= Elasticsearch8/postgresql-x64-11/Redis
This overwrites any existing dependencies, so you do not need to remove old ones.
Install Elasticsearch 8 on Docker
Both the source Elasticsearch and the new Elasticsearch 8 must run at once, each with its own service block and a unique name in docker-compose.yml.
-
Stop the Informer services:
docker-compose stop -
Edit
docker-compose.yml. Add anelasticsearch8service alongside the existingelasticsearchservice:elasticsearch8:image: elastic/elasticsearch:8.4.0environment:- TZ=timezonegoeshere- ES_JAVA_OPTS=-Xms4g -Xmx4g- xpack.security.enabled=false- discovery.type=single-node- reindex.remote.whitelist="*:*"volumes:- ./esdata8:/usr/share/elasticsearch/dataThen, in each Informer service (API, Query, and Schedules by default), point Informer at the new Elasticsearch and update the dependency:
environment:- elastic__host=elasticsearch8- elastic__version=8depends_on:- "elasticsearch8" -
Create an
esdata8directory at the Informer install root, and make sure your user is in the docker group (see Docker's post-installation steps for Linux). -
Give Elasticsearch 8 ownership of its host data directory (replace
1000if the container uses a non-default UID):chown -R 1000:0 esdata8 -
Set the host's max map count by adding this line to
/etc/sysctl.conf, then applying it:vm.max_map_count=262144sudo sysctl -p -
Recreate the Informer containers and start:
docker-compose rm informer-apidocker-compose rm informer-querydocker-compose rm informer-schedulesdocker-compose pull./start.sh
Both Elasticsearch instances are now running. Run the Migration Utility (below). When it finishes, stop Informer, remove the old elasticsearch (version 5) block and the reindex.remote.whitelist property from the elasticsearch8 block, save, and restart Informer.
Elasticsearch Migration Utility
Elasticsearch 5 index folders are incompatible with version 7 and later, so the Migration Utility copies the indices into Elasticsearch 8. Before starting, install Elasticsearch 8, make sure both the source and the new Elasticsearch are running, and confirm Informer is connected to Elasticsearch 8. There must be enough disk for duplicate data and enough memory for both services.
Migrations are done per tenant.
-
Open the utility at
http://<informer>/elastic-migrate, where<informer>is your Informer URL.Do not use the loopback addressUse the explicit IP address (or hostname) and port of the source Elasticsearch server, not the loopback. This is critical for Docker-based Elasticsearch.
- Windows: use the
hostfield fromconfig.json. With defaults, the source URL ishttp://localhost:9200. - Docker: use the source Elasticsearch service name and port, for example
http://elasticsearch:9200.
- Windows: use the
-
Enter the URL, username, and password for the source Elasticsearch connection and click Connect. Most deployments use port
9200with no username or password. -
A list of eligible Datasets appears. A checkbox at the bottom includes Snapshots in the migration. A Dataset or Snapshot is eligible when it:
- is a top-level Dataset (or the Snapshot of one),
- has a non-empty
esIndexvalue, - has an
esIndexthat exists and is non-empty in the source Elasticsearch, and - has an
esIndexthat does not yet exist in the target Elasticsearch 8.
-
Select the Datasets to migrate, then click Copy Data.
-
As each Dataset or Snapshot is written to Elasticsearch 8, it is removed from the grid.
The utility streams data from the source index into a new index in Elasticsearch 8, then runs the current initialization so type mappings are set correctly. Data in the previous index is preserved. If a selected index is missing from the source, it is logged and the utility continues.
After migrating:
-
Docker: with Informer running, prune the orphaned Elasticsearch 5 containers:
sudo docker system prune -a --volumes -
Windows: stop and disable the now-redundant Elasticsearch 5 service.