influxdb-backup.sh is a simple bash script which uses curl and jq to dump and restore all the points in an influxdb database.
./influxdb-backup.sh dump
fetches all points from a database and outputs them as line-delimited JSON to stdout../influxdb-backup.sh restore
reads a dump from stdin and writes all points to a database one by one.
Download influxdb-backup.sh
to your computer and make it executable:
$ curl https://raw.githubusercontent.com/eckardt/influxdb-backup.sh/master/influxdb-backup.sh -o influxdb-backup.sh && chmod +x ./influxdb-backup.sh && ./influxdb-backup.sh -?
To copy all datapoints (all series) from one database to another do:
$ ./influxdb-backup.sh dump oldDB | ./influxdb-backup.sh restore newDB
See ./influxdb-backup.sh dump -?
for more usage information:
Usage: ./influxdb-backup.sh dump DATABASE [options...]
-u USERNAME (default: root)
-p PASSWORD (default: root)
-h HOST (default: localhost:8086)
-s (use HTTPS)