[solved] Rebuild telegraf+influxDB to a new VM

So have been asked to be ready for rebuilding the entire monitoring setup due to a VM issue (multitude SNMP counters so it’s critical! :scream:) collection done via telegraf and data store with InfluxDB.

Please suggest best practices. This is what I’ve listed so far:

  1. telegraf config files
  2. InfluxDB config files
  3. Custom exporters
  4. Cron job details
  5. One of the most important I’m concerned with historical data. Referred to this link Backup and Restore | InfluxData Documentation Archive
    Have you guys had any problems in backing and restoring into a new InfluxDB setup.

Any comments appreciated. Thanks

I’ve never done it. I’m just thinking out loud to give you some ideas.

It’s probably handled by the backup and restore but you have to create your databases, create your users, create your retention policies, grant permissions to the users.

If :

  • you are migrating to a newer version of InfluxDB and Telegraf
  • your previous InfluxDB server still works
  • backup and restore does not work accross versions (I have no idea if it works or not)

You could write a script that queries the older server and writes to the newer server. You’ll have to copy from the oldest data to the newest and batch a day or week at a time.

If you also used Kapacitor, you’d have to copy the kapacitor config file, your TICKscripts and UDFs.

Worked clean as a whistle! InfluxDB rocks :+1::+1::+1:

Steps I followed:

  1. Stop InfluxDB and telegraf services
  2. Backup /meta and /data directories using tar -cvf
  3. SCP the archive
  4. Make sure the services are stopped on the new VM
  5. Restore with tar xvf. Ensure you do this on an empty directory and then you can recursively overwrite directories since you’re starting on an empty time series DB anyway
  6. Start InfluxDB services and telegraf services
  7. Ensure you recompile your exporters, check cron tab as necessary

Kind regards

Did you reinstall the same version or did you upgrade to a newer version at the same time ?

I maintained the same version as before just to be sure