Back up data

Use the influx backup command to back up data and metadata stored in InfluxDB. InfluxDB copies all data and metadata to a set of files stored in a specified directory on your local filesystem.

InfluxDB 2.0 (release candidate)

The influx backup command is not compatible with InfluxDB 2.0 (release candidate). To back up data,

  1. Stop influxd.
  2. Manually copy the InfluxDB data directories:

    1. cp -r ~/.influxdbv2 ~/.influxdbv2_bak

For more information, see Upgrade to InfluxDB OSS 2.0.

The influx backup command cannot back up data stored in InfluxDB Cloud.

The influx backup command requires:

  • The directory path for where to store the backup file set
  • The root authorization token (the token created for the first user in the InfluxDB setup process).
Back up data with the influx CLI
  1. # Syntax
  2. influx backup <backup-path> -t <root-token>
  3. # Example
  4. influx backup \
  5. path/to/backup_$(date '+%Y-%m-%d_%H-%M') \
  6. -t xXXXX0xXX0xxX0xx_x0XxXxXXXxxXX0XXX0XXxXxX0XxxxXX0Xx0xx==

Related articles