Search code examples
influxdb

Migrate from InfluxCloud


What would be the best approach to migrate FROM InfluxCloud to my own InfluxDB Instance.

Obviously, the influxd backup/restore functionality would be perfect, but that one does not work on InfluxCloud as stated on their documentation


Solution

  • I've recently had to do something similar and used the following approach.

    1. Use a CURL request to output the collection in a json file

      curl "https://CLOUD-ENDPOINT.influxcloud.net:8086/db/DATABASE_NAME/series?u=USERNAME&p=PASSWORD&q=select%20*%20from%20DATABASE_NAME%3B" > output.json
      

      Replace CLOUD_ENDPOINT, DATABASE_NAME, USERNAME and PASSWORD with the correct values.

    2. Convert the json file to Line protocol. There already exist a lot of scripts for this. Example: influx-json2line

    3. Use influx CLI to import the file again.