You might want to move data from your local InfluxDB or InfluxDB Enterprise instance into InfluxCloud. To do that, you need to first extract your data from InfluxDB using line protocol, and then you can import it into your InfluxCloud subscription.

Exporting data from InfluxDB

First, export the data from your InfluxDB or InfluxDB Enterprise instance using the influx_inspect utility with the export command and -compress option, like below:

$ influx_inspect export -compress

Things to note:

  • The default location for the export file is in $HOME/.influxdb/data. To change the location for the export file, add the -out <export_dir> option.
  • By default, export exports all databases from your instance. To import specific databases, use the -database <db_name> option.
  • Click here for a complete list of available export options.

Connecting to InfluxCloud

Next, you need to connect to InfluxCloud through the command line interface (CLI). Run the following command. substituting your details where needed:

$ influx -host <your_hostname> -port 8086 -username $INFLUX_USERNAME -password $INFLUX_PASSWORD -ssl

At this point, you should see text confirming you’re successfully connected.

Import data into InfluxCloud

Finally, import the data you exported above into InfluxCloud by running the following command:

$ -import -path= ~/.influxdb/export

Things to note:

  • In the example above, the path is the default location where the export file was created. If you specified a different path for your export file, use that instead.
  • If you try to import data into an existing database and the time stamps for any of the data points exceed the defined retention policy, these data points will be ignored (not imported). For example, if the data you exported has an infinite retention policy and you try to import it into an existing database with a seven day retention policy, only data which falls within the last seven days will be imported.
  • Click here for additional details about using -import and available options.