Documentation

Migrate data from InfluxDB 1.x to IOx in InfluxDB Cloud

To migrate data from an InfluxDB 1.x OSS or Enterprise instance to InfluxDB Cloud backed by InfluxDB IOx, export the data as line protocol and write the exported data to an IOx bucket in your InfluxDB Cloud organization. Because full data migrations will likely exceed your organizations’ limits and adjustable quotas, migrate your data in batches.

All write requests are subject to your InfluxDB Cloud organization’s rate limits and adjustable quotas.

Tools to use

The migration process uses the following tools:

InfluxDB 1.x and 2.x CLIs are unique

If both the InfluxDB 1.x and 2.x influx CLIs are installed in your $PATH, rename one of the the binaries to ensure you’re executing commands with the correct CLI.

Migrate data

  1. Export data from your InfluxDB 1.x instance as line protocol.

    Use the InfluxDB 1.x influx_inspect export utility to export data as line protocol and store it in a file. Include the following:

    • (Required) -lponly flag to export line protocol without InfluxQL DDL or DML.
    • (Required) -out flag with a path to an output file. Default is ~/.influxdb/export. Any subsequent export commands without the output file defined will overwrite the existing export file.
    • -compress flag to use gzip to compress the output.
    • -datadir flag with the path to your InfluxDB 1.x data directory. Only required if the data directory is at a non-default location. For information about default locations, see InfluxDB OSS 1.x file system layout or InfluxDB Enterprise 1.x file system layout.
    • -waldir flag with the path to your InfluxDB 1.x wal directory. Only required if the wal directory is at a non-default location. For information about default locations, see InfluxDB OSS 1.x file system layout or InfluxDB Enterprise 1.x file system layout.
    • -database flag with a specific database name to export. By default, all databases are exported.
    • -retention flag with a specific retention policy to export. By default, all retention policies are exported.
    • -start flag with an RFC3339 timestamp that defines the earliest time to export. Default is 1677-09-20T16:27:54-07:44.
    • -end flag with an RFC3339 timestamp that defines the latest time to export. Default is 2262-04-11T16:47:16-07:00.

    We recommend exporting each database and retention policy combination separately to easily write the exported data into corresponding InfluxDB Cloud buckets.

    Export all data in a database and retention policy to a file
    influx_inspect export \
      -lponly \
      -database example-db \
      -retention example-rp \
      -out path/to/export-file.lp
    
    View more export command examples:

    Export all data to a file

    Export all data to a compressed file

    Export data within time bounds to a file

    Export a database and all its retention policies to a file

    Export a specific database and retention policy to a file

    Export all data from non-default data and wal directories

  2. Create InfluxDB Cloud buckets for each InfluxDB 1.x database and retention policy combination. InfluxDB Cloud combines InfluxDB 1.x databases and retention policies into buckets–named locations for time series data with specified retention periods.

    View example 1.x databases and retention policies as InfluxDB Cloud buckets

    Use the InfluxDB 2.x influx CLI or the InfluxDB Cloud user interface (UI) to create a bucket.

    Use the influx bucket create command to create a new bucket.

    Provide the following:

    influx bucket create \
      --name example-db/autogen \
      --retention 7d
    
    1. Go to cloud2.influxdata.com in a browser to log in and access the InfluxDB UI.

    2. Navigate to Load Data > Buckets using the left navigation bar.

    3. Click + Create bucket.

    4. Provide a bucket name (for example: example-db/autogen) and select a retention period. Supported retention periods depend on your InfluxDB Cloud plan.

    5. Click Create.

  3. Write the exported line protocol to your InfluxDB Cloud organization backed by InfluxDB IOx.

    Use the InfluxDB 2.x CLI to write data to InfluxDB Cloud. While you can use the /api/v2/write API endpoint to write data directly, the influx write command lets you define the rate at which data is written to avoid exceeding your organization’s rate limits.

    Use the influx write command and include the following:

    • InfluxDB Cloud connection and authentication credentials
    • -b, --bucket flag to identify the target bucket.
    • -f, --file flag with the path to the line protocol file to import.
    • -rate-limit flag with a rate limit that matches your InfluxDB Cloud organization’s write rate limit.
    • --compression flag to identify the compression type of the import file. Options are none or gzip. Default is none.

    Authentication credentials

    The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags:

    • --host: InfluxDB host
    • -o, --org or --org-id: InfluxDB organization name or ID
    • -t, --token: InfluxDB API token
    influx write \
      --bucket example-db/autogen \
      --file path/to/export-file.lp \
      --rate-limit "300 MB / 5 min"
    
    influx write \
      --bucket example-db/autogen \
      --file path/to/export-file.lp.gzip \
      --rate-limit "300 MB / 5 min" \
      --compression gzip
    
    Repeat for each export file and target bucket.

Was this page helpful?

Thank you for your feedback!


Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

InfluxDB Cloud backed by InfluxDB IOx

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by IOx, this is the correct documentation.

If powered by TSM, see the TSM-based InfluxDB Cloud documentation.

InfluxDB Cloud backed by InfluxDB TSM

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine which enables nearly unlimited series cardinality and SQL query support. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by TSM, this is the correct documentation.

If powered by IOx, see the IOx-based InfluxDB Cloud documentation.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.