Hello Alvaro,
It could be done by moving the configuration files of the managers but take into account that if you copy the directory to the new server and install from sources the startup services will not work. To migrate from Wazuh Manager to a new server follow these steps:
1. Backup your files. To avoid losing any configuration, or agent keys, stop manager service and then make a copy of /var/ossec (default installation directory).
2. Install Wazuh Manager in the new server. Do no select to run Manager after installation.
3. Restore configuration. Before you attempt restoration make sure the Manager is stopped in the new server.
cp -p /var/ossec_backup/etc/client.keys /var/ossec/etc/
cp -p /var/ossec_backup/etc/ossec.conf /var/ossec/etc/
cp -p /var/ossec_backup/queue/rids/sender_counter /var/ossec/queue/rids/sender_counter
If you have made local changes to any of the following then also restore:
cp -p /var/ossec_backup/etc/local_internal_options.conf /var/ossec/etc/local_internal_options.conf
cp -p /var/ossec_backup/rules/local_rules.xml /var/ossec/etc/rules/local_rules.xml
cp -p /var/ossec_backup/etc/local_decoder.xml /var/ossec/etc/decoders/local_decoder.xml
If you have the centralized configuration you must restore:
cp -p /var/ossec_backup/etc/shared/agent.conf /var/ossec/etc/shared/default/agent.conf
Optionally the following files can be restored to preserve alert log files and syscheck/rootcheck databases:
cp -rp /var/ossec_backup/logs/archives/* /var/ossec/logs/archives
cp -rp /var/ossec_backup/logs/alerts/* /var/ossec/logs/alerts
cp -rp /var/ossec_backup/queue/rootcheck/* /var/ossec/queue/rootcheck
cp -rp /var/ossec_backup/queue/syscheck/* /var/ossec/queue/syscheck
4. Start Wazuh Manager service
5. If your are using a Load Balancer it won't be necessary to change the MANAGER IP on the agents to report as they will be pointing to it. No changes over the agents configuration will be necessary either if you are not using a Load Balancer but the IP of the manager (Master or worker) you want the Agent to report to on the new server remains the same.
In case you are not using a Load Balancer and the IP of the manager (Master or worker) you want the Agent to report to has changed then you will need to update the MANAGER IP on the ossec.conf of every agent and restart them.
You will find the MANAGER IP on the `<server>` section of `ossec.conf`:
```
<client>
<server>
<address>YOUR MANAGER IP (Master or Worker)</address>
```
Just in case you are not using one, a Load Balancer on a Wazuh cluster is strongly recommended.
I hope this helps.
Best regards,
Carlos.