Backup and restore InfluxDB database - lucoenergia/conluz GitHub Wiki

Backing up and restoring a database in InfluxDB 1.8 involves the following steps.

Backup a database

  1. Make sure the InfluxDB service is running.

  2. Run the following command to backup the database into an archive:

influxd backup -portable -database conluz_db /path/to/your/backup/directory/

Note: Replace '/path/to/your/backup/directory/' with your desired backup directory.

This command will create a set of '.tar.gz' files in the backup directory. These files represent your backup.

Restoring the database

  1. Stop the InfluxDB service.

  2. Use the following command to restore the database from the backup file:

influxd restore -portable -db conluz_db /path/to/your/backup/directory/

Note: Replace '/path/to/your/backup/directory/' with the directory where your backup files reside.

  1. Start the InfluxDB service.

  2. Verify the restoration by logging in to the InfluxDB and checking the restored data.

Check the official documentation for more specific details -> https://docs.influxdata.com/influxdb/v1/administration/backup_and_restore/#restore-a-specific-database