Upgrade from InfluxDB 1.x to InfluxDB Cloud
To upgrade from InfluxDB OSS 1.x to InfluxDB Cloud:
- Create an InfluxDB Cloud account
- Create an All-Access API token
- Download and install the
influx
CLI - Create DBRP mappings
- Dual write to InfluxDB 1.x and InfluxDB Cloud
- Migrate time series data
- Migrate continuous queries
- Collaborate with other users
Create an InfluxDB Cloud account
Do one of the following to create an InfluxDB Cloud account:
- Subscribe through InfluxData and start for free.
- Subscribe through your cloud provider.
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.
Click Data (Load Data) > Tokens in the left navigation bar.
Click Generate, and then select All-Access Token.
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
Visit the InfluxDB downloads page and download the InfluxDB Cloud CLI (
influx
).Place the
influx
binary in your systemPATH
or execute the CLI commands from the directory where theinflux
CLI exists.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
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
Create a DBRP mapping
Use theinflux 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:
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"
Add the
INFLUX_TOKEN
environment variable to your Telegraf environment(s) and set the value to your InfluxDB Cloud API token.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:
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
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
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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.