Search code examples
influxdb

Export data from InfluxDB


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.


Solution

  • 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