Documentation

Migrate data from InfluxDB 1.x to InfluxDB Cloud Dedicated

To migrate data from an InfluxDB 1.x OSS or Enterprise instance to InfluxDB Cloud Dedicated, export the data as line protocol and write the exported data to an InfluxDB Cloud Dedicated database.

Before you migrate

Before you migrate from InfluxDB 1.x to InfluxDB Cloud Dedicated, there are schema design practices supported by the TSM storage engine that are not supported in the InfluxDB v3 storage engine. Specifically, InfluxDB v3 enforces the following schema restrictions:

  • You can’t use duplicate names for tags and fields.
  • By default, measurements can contain up to 250 columns where each column represents time, a field, or a tag.

For more information, see Schema restrictions.

If your schema does not adhere to these restrictions, you must update your schema before migrating to InfluxDB Cloud Dedicated.

Fix duplicate tag and field names

Fix measurements with more than 250 total columns

Tools to use

The migration process uses the following tools:

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 Dedicated databases.

    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 Dedicated databases for each InfluxDB 1.x database and retention policy combination.

    If coming from InfluxDB v1, the concepts of databases and retention policies have been combined into a single concept–database. Retention policies are no longer part of the InfluxDB data model. However, InfluxDB Cloud Dedicated does support InfluxQL, which requires databases and retention policies. See InfluxQL DBRP naming convention.

    If coming from InfluxDB v2 or InfluxDB Cloud, database and bucket are synonymous.

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

    Use the influxctl database create command to create a database in your InfluxDB Cloud Dedicated cluster.

    Provide the following arguments:

    influxctl database create --retention-period 30d <DATABASE_NAME>
    

    To learn more about databases in InfluxDB Cloud Dedicated, see Manage databases.

  3. Create a database token for writing to your InfluxDB Cloud Dedicated database.

    Use the influxctl token create command to create a database token with write permission to your database.

    Provide the following:

    • Permission grants
      • --read-database: Grants read access to a database
      • --write-database Grants write access to a database
    • Token description
    influxctl token create \
      --read-database example-db \
      --write-database example-db \
      "Read/write token for example-db database"
    
  4. Write the exported line protocol to your InfluxDB Cloud Dedicated cluster.

    Use the v1 API or v2 API endpoints to write data to your InfluxDB Cloud Dedicated cluster.

    Choose from the following options:

    Write each export file to the target database.

    v2.x influx CLI not supported

    Don’t use the influx CLI with InfluxDB Cloud Dedicated. While it may coincidentally work, it isn’t officially supported.

    For help finding the best workflow for your situation, contact Support.


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following: