Manually upgrade from InfluxDB 1.x to 2.2

  1. Migrate custom configuration settings
  2. Create authorizations
  3. Migrate continuous queries

.

Required 2.x credentials

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

Migrate custom configuration settings

If you’re using custom configuration settings in your InfluxDB 1.x instance, do the following:

  1. Compare 1.x and 2.2 configuration settings:

    View configuration option parity

    1.x configuration groups not in 2.2

    The following 1.x configuration groups do not apply to InfluxDB 2.2:

    • meta
    • coordinator
    • subscriber
    • graphite
    • collectd
    • opentsdb
    • udp
    • continuous_queries
  2. Apply your 1.x custom settings to the comparable InfluxDB 2.2 settings using influxd flags, environment variables, or a 2.2 configuration file. For more information about configuring InfluxDB 2.2, see Configuration options.

  3. Restart influxd.

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

To map a DBRP combination to an InfluxDB 2.2 bucket:

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

  2. Create a DBRP mapping
    Use the 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

    DB with multiple RPs

    1. influx v1 dbrp create \
    2. --db example-db \
    3. --rp example-rp \
    4. --bucket-id 00xX00o0X001 \
  3. Confirm the DBRP mapping was created
    Use the to list existing DBRP mappings.

    1. influx v1 dbrp list

For information about managing DBRP mappings, see the influx v1 dbrp command documentation.

Create authorizations

InfluxDB 2.2 requires authentication and provides two authentication methods:

Use InfluxDB 2.2 token authentication to authenticate requests to InfluxDB 2.2.

  • Your 1.x instance does not have authentication enabled.

Use tokens with basic authentication

To use tokens with InfluxDB clients that require an InfluxDB username and password, provide an arbitrary user name and pass the token as the password.

1.x-compatible authorizations

  • You’re using InfluxDB 1.x clients or client libraries configured with InfluxDB usernames and passwords.

1.x compatibility authorizations are separate from credentials used to log into the InfluxDB 2.2 user interface (UI).

Create a 1.x-compatible authorization

Use the InfluxDB 2.2 influx v1 auth create command to create a 1.x-compatible authorization that grants read/write permissions to specific 2.2 buckets. Provide the following:

  • list of to grant read or write permissions to
  • new v1 auth username
  • new v1 auth password (when prompted)

Single bucket

  1. influx v1 auth create \
  2. --read-bucket 00xX00o0X001 \
  3. --read-bucket 00xX00o0X002 \
  4. --write-bucket 00xX00o0X001 \
  5. --write-bucket 00xX00o0X002 \
  6. --username example-user

For information about managing 1.x compatible authorizations, see the influx v1 auth command documentation.

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

  1. Use the InfluxDB 1.x to export time series data as line protocol. Include the 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 2.2 bucket.

  2. Use the InfluxDB 2.2 influx write command to write the exported line protocol to InfluxDB 2.2.

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

Migrate continuous queries