Dump the MySQL database on the old server:
mysqldump -u root -p librenms > librenms_backup.sql
Create an archive of the RRD data and the config files on the old server:
sudo tar czvf rrd_config_backup.tar.gz /opt/librenms/rrd /opt/librenms/.env /opt/librenms/config.php
Transfer the MySQL dump file and the archive to the new server using SCP
Extract the archive:
sudo tar -xzvf rrd_config_backup.tar.gz -C
Import the MySQL dump:
mysql -u root -p librenms < librenms_backup.sql
Restart MySQL:
sudo systemctl restart mysql
Set folder permissions:
sudo chown -R librenms:librenms /opt/librenms
sudo chmod -R ug=rwX /opt/librenms
sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache /opt/librenms/storage
sudo setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache /opt/librenms/storage
Enable Cron Poller and Updates:
sudo sed -i 's/^#//' /etc/cron.d/librenms
Update /opt/librenms/config.php with new server IP if different.
Run /opt/librenms/validate.php as the librenms user - all checks should pass. Resolve any issues listed.
If the new server has a different IP address, the base URL needs set to the new one using the libremns user:
lnms config:set base_url http://
Web login should work with original credentials.
Once data is coming in for devices, back up just the RRD files on the old server again, to fill in the gaps:
tar -czvf librenms_rrd.tar.gz /opt/librenms/rrd
Transfer that file with SCP to the new server
Extract the historical RRD files on the new server:
tar -xzvf librenms_rrd.tar.gz -C /
Don't forget to clean files from the home directory on the new server once done.