Documentation

Upgrade from InfluxDB 1.x to InfluxDB Cloud

To upgrade from InfluxDB OSS 1.x to InfluxDB Cloud:

  1. Create an InfluxDB Cloud account
  2. Create an All-Access API token
  3. Download and install the influx CLI
  4. Create DBRP mappings
  5. Dual write to InfluxDB 1.x and InfluxDB Cloud
  6. Migrate time series data
  7. Migrate continuous queries
  8. Collaborate with other users

Create an InfluxDB Cloud account

Do one of the following to create an InfluxDB Cloud account:

Create an All-Access API token

InfluxDB Cloud uses authentication tokens to authorize API requests.

Create an All-Access token in your InfluxDB Cloud user interface (UI) to use for the upgrade process.

  1. Click Data (Load Data) > Tokens in the left navigation bar.

  2. Click Generate, and then select All-Access Token.

  3. Enter a description for the token, and then click Save.

For more information about managing tokens and token types, see Manage tokens.

Download and install the influx CLI

  1. Visit the InfluxDB downloads page and download the InfluxDB Cloud CLI (influx).

  2. Place the influx binary in your system PATH or execute the CLI commands from the directory where the influx CLI exists.

  3. Create a CLI connection configuration for your InfluxDB Cloud account. Include the following flags:

    • --config-name: Unique name for the connection configuration.
    • --host-url: InfluxDB Cloud region URL.
    • --org: InfluxDB Cloud organization name. The default organization name is the email address associated with your account.
    • --token: InfluxDB Cloud All-Access token.
    influx config create \
      --config-name cloud \
      --host-url https://cloud2.influxdata.com \
      --org your.email@example.com \
      --token mY5uP3rS3cRe7Cl0uDt0K3n \
      --active
    

Required InfluxDB Cloud credentials

All influx CLI examples below assume the required InfluxDB Cloud host, organization, and API token credentials are provided by your influx CLI configuration.

Create DBRP mappings

InfluxDB database and retention policy (DBRP) mappings associate database and retention policy combinations with InfluxDB cloud buckets. These mappings allow InfluxDB 1.x clients to query and write to InfluxDB Cloud buckets while using the 1.x DBRP convention.

For more information about DBRP mapping, see Database and retention policy mapping.

To map a DBRP combination to an InfluxDB Cloud bucket

  1. Create a bucket
    Create an InfluxDB Cloud bucket. We recommend creating a bucket for each unique 1.x database and retention policy combination using the following naming convention:

    # Naming convention
    db-name/rp-name
    
    # Example
    telegraf/autogen
    
  2. Create a DBRP mapping
    Use the influx v1 dbrp create command to create a DBRP mapping. Provide the following:

    • database name
    • retention policy name (not retention period)
    • bucket ID
    • (optional) --default flag if you want the retention policy to be the default retention policy for the specified database

    influx v1 dbrp create \
      --db example-db \
      --rp example-rp \
      --bucket-id 00xX00o0X001 \
      --default
    
    # Create telegraf/autogen DBRP mapping with autogen
    # as the default RP for the telegraf DB
    
    influx v1 dbrp create \
      --db telegraf \
      --rp autogen \
      --bucket-id 00xX00o0X001 \
      --default
    
    # Create telegraf/downsampled-daily DBRP mapping that
    # writes to a different bucket
    
    influx v1 dbrp create \
      --db telegraf \
      --rp downsampled-daily \
      --bucket-id 00xX00o0X002
    

Dual write to InfluxDB 1.x and InfluxDB Cloud

Update external clients to write to your InfluxDB Cloud instance. We recommend writing data to both InfluxDB 1.x and InfluxDB Cloud until you finish migrating your existing time series data.

Configure external clients with your InfluxDB Cloud host, organization, and API token.

Update Telegraf configurations

If using Telegraf to collect and write metrics to InfluxDB 1.x, update your Telegraf configuration to write to both InfluxDB 1.x and InfluxDB Cloud:

  1. Update your Telegraf configuration with a influxdb_v2 output to write to your InfluxDB Cloud instance.

    Example dual-write Telegraf configuration
    # Write metrics to InfluxDB 1.x
    [[outputs.influxdb]]
      urls = ["https://localhost:8086"]
      database = "example-db"
      retention_policy = "example-rp"
    
    # Write metrics to InfluxDB Cloud
    [[outputs.influxdb_v2]]
      urls = ["https://cloud2.influxdata.com"]
      token = "$INFLUX_TOKEN"
      organization = "your.email@example.com"
      bucket = "example-db/example-rp"
    
  2. Add the INFLUX_TOKEN environment variable to your Telegraf environment(s) and set the value to your InfluxDB Cloud API token.

  3. Restart Telegraf with the updated configuration and begin writing to both InfluxDB 1.x and InfluxDB Cloud.

Migrate time series data

To migrate time series data from your InfluxDB 1.x instance to InfluxDB Cloud:

  1. Use the InfluxDB 1.x influx_inspect export command to export time series data as line protocol. Include the -lponly flag to exclude comments and the data definition language (DDL) from the output file.

    We recommend exporting each DBRP combination separately to easily write data to a corresponding InfluxDB Cloud bucket.

    # Syntax
    influx_inspect export \
      -database <database-name> \
      -retention <retention-policy-name> \
      -out <output-file-path> \
      -lponly
    
    # Example
    influx_inspect export \
      -database example-db \
      -retention example-rp \
      -out /path/to/example-db_example-rp.lp \
      -lponly
    
  2. Use the InfluxDB Cloud influx write command to write the exported line protocol to InfluxDB Cloud.

    # Syntax
    influx write \
      --bucket <bucket-name> \
      --file <path-to-line-protocol-file>
    
    # Example
    influx write \
      --bucket example-db/example-rp \
      --file /path/to/example-db_example-rp.lp
    
  3. Repeat steps 1-2 for each bucket.

InfluxDB Cloud write rate limits

Read and write requests are subject to rate limits associated with your InfluxDB Cloud plan. If your exported line protocol size potentially exceeds your rate limits, include the --rate-limit flag with influx write to rate limit written data.

influx write \
  --bucket example-bucket \
  --file /path/to/example-db_example-rp.lp \
  --rate-limit "5MB/5min"

To minimize network bandwidth usage, we recommend using gzip to compress exported line protocol. However, when writing to InfluxDB Cloud, Data In and Ingest batch size rate limits track the payload size of the uncompressed line protocol.

Migrate continuous queries

For information about migrating InfluxDB 1.x continuous queries to InfluxDB Cloud tasks, see Migrate continuous queries to tasks.

Collaborate with other users

To collaborate with other users in your InfluxDB Cloud organization, invite users to join your organization.


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.

Read more

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered

InfluxDB Cloud powered by TSM