Is there a way (plugin or tool) to export the data from the database (or database itself) ? I'm looking for this feature as I need to migrate a DB from present host to another one.
Writing points from a fileWrite points from a file by passing @filename to curl . The data in the file should follow the InfluxDB line protocol syntax. Note: If your data file has more than 5,000 points, it may be necessary to split that file into several files in order to write your data in batches to InfluxDB.
The built-in web administration GUI is a simple way to interact with InfluxDB. For any significant use, whether writing or querying data, the HTTP API (reading, writing) or the command line interface are better options.
InfluxDB is similar to a SQL database, but different in many ways. InfluxDB is purpose-built for time series data. Relational databases can handle time series data, but are not optimized for common time series workloads.
Export data:
sudo service influxdb start (Or leave this step if service is already running) influxd backup -database grpcdb /opt/data
grpcdb is name of DB and back up will be saved under /opt/data directory in this case.
Import Data:
sudo service influxdb stop (Service should not be running) influxd restore -metadir /var/lib/influxdb/meta /opt/data influxd restore -database grpcdb -datadir /var/lib/influxdb/data /opt/data sudo service influxdb start
You could dump each table and load them through REST interface:
curl "http://hosta:8086/db/dbname/series?u=root&p=root&q=select%20*%20from%20series_name%3B" > series_name.json curl -XPOST -d @series_name.json "http://hostb:8086/db/dbname/series?u=root&p=root"
Or, maybe you want to add new host to cluster? It's easy and you'll get master-master replica for free. Cluster Setup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With