Hello
You can tackle the problem using different approaches.
- Wazuh side:
* Move all the agents. You can re-register all the Wazuh agents in the new Wazuh server. Using the
agent-auth binary, the
Wazuh API, etc. Even you can copy the /var/ossec/etc/client.keys from the old Wazuh server to the new one and change the Wazuh server IP in the Wazuh agent configuration files and they will report directly to the new Wazuh server without re-register.
* Move the Wazuh server data. The Wazuh alerts are rotated, compressed, and stored in /var/ossec/logs/alerts/ folder. Those data have been ingested by Elasticsearch using filebeat, so it's duplicated in two places. If you want to have the "raw" Wazuh alerts then, you can move the mentioned folder to the new server.
- Elasticsearch data:
So, a good plan could be:
1.- Wazuh agent migration.
2.- Once the migration is complete, and new data is received by the new Elasticsearch, start the Elasticsearch data migration using their API method.
Take into account that, depending on the stress level of your Elasticsearch node, maybe could be better to migrate Elasticsearch data before migrating agents. This is 1: Migrate Elasticsearch data from the beginning to the migration day, 2: Migrate the Wazuh agents, 3: Migrate the Elasticsearch data of the migration day. The stress caused would be less because is fewer data to ingest meanwhile is ingesting Wazuh alerts in real-time. Only in cases when the Elasticsearch node/s is/are stressed.
Regards,
Alberto R