Manual upgrade / upgrade doc restructure (#2264)
* Start work on "Manually upgrade" docs - Add content from Grafana doc - Begin adding context and introduction - Add content from automatic upgrade guide - Mention secure-by-default - Add backup warning * Add info about authorizing `influx v1` commands * Apply suggestions from code review Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Add influxd upgrade recommendation * Update content/influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Add conceptual info to `influx v1 auth` CLI docs * Work on PR feedback * Work on outline and ToC * Reorder migrate data instructions * Work on guide Add related links * Edit data migrations section * Mention "manual upgrade path" in automatic upgrade doc * Spell check * Add link and move manual upgrade notes in auto guide * Work on guide * Fix notes for directing users to right upgrade guides * Reorgization upgrade docs * Work on Upgrade landing page * Start clarifying decision tree * Rm comments * Clean up landing page * updates to 2.0 upgrade guides * more updates to manual upgrade guide * more updates to upgrade docs * updated reference docs * Apply suggestions from code review Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * fixed typos in auto-upgrade guide * Apply suggestions from code review Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * fixed structure of migrate config settings * updated upgrade landing structure, updated links Co-authored-by: pierwill <pierwill@users.noreply.github.com> Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> Co-authored-by: Scott Anderson <scott@influxdata.com> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>pull/1308/head
parent
f21932e8b1
commit
53f4f4d1c8
|
@ -7,7 +7,7 @@
|
|||
.expand {
|
||||
border-top: 1px solid $article-hr;
|
||||
padding: .75rem 0;
|
||||
&:last-of-type { border-bottom: 1px solid $article-hr; }
|
||||
&:last-of-type, &:only-child { border-bottom: 1px solid $article-hr; }
|
||||
}
|
||||
|
||||
.expand-label {
|
||||
|
|
|
@ -18,13 +18,14 @@ data and metadata stored in InfluxDB.
|
|||
InfluxDB copies all data and metadata to a set of files stored in a specified directory
|
||||
on your local filesystem.
|
||||
|
||||
{{% warn %}}
|
||||
#### InfluxDB 1.x/2.0 Compatibility
|
||||
The `influx backup` command is not compatible with versions of InfluxDB prior to 2.0.0.
|
||||
In addition, the `backup` and `restore` commands do not function across 1.x and 2.x releases.
|
||||
Use the `influx upgrade` command instead.
|
||||
For more information, see [Upgrade to InfluxDB OSS 2.0](/influxdb/v2.0/upgrade/v1-to-v2/).
|
||||
{{% /warn %}}
|
||||
{{% note %}}
|
||||
#### InfluxDB 1.x/2.0 compatibility
|
||||
The InfluxDB 2.0 `influx backup` command is not compatible with versions of InfluxDB prior to 2.0.0.
|
||||
**For information about migrating data between InfluxDB 1.x and 2.0, see:**
|
||||
|
||||
- [Automatically upgrade from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/automatic-upgrade/)
|
||||
- [Manually upgrade from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade/)
|
||||
{{% /note %}}
|
||||
|
||||
{{% cloud %}}
|
||||
The `influx backup` command **cannot** back up data stored in **{{< cloud-name "short" >}}**.
|
||||
|
|
|
@ -35,11 +35,10 @@ For complete InfluxQL reference documentation, see
|
|||
## Verify buckets have a mapping
|
||||
|
||||
{{% note %}}
|
||||
When [upgrading from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/), InfluxDB
|
||||
automatically creates buckets for each database and retention policy combination
|
||||
and DBRP mappings for those buckets.
|
||||
When [upgrading from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/),
|
||||
Database and retention policy combinations are mapped to InfluxDB 2.0 buckets.
|
||||
For more information, see [Database and retention policy mapping](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/).
|
||||
If you're not sure how data was written into a bucket, we recommend verifying the bucket has a mapping.
|
||||
If you're not sure how data was written into a bucket, verify the bucket has a mapping.
|
||||
{{% /note %}}
|
||||
|
||||
Use the [`influx` CLI](/influxdb/v2.0/reference/cli/influx/) or the [InfluxDB API](/influxdb/v2.0/reference/api/)
|
||||
|
|
|
@ -11,6 +11,7 @@ weight: 104
|
|||
influxdb/v2.0/tags: [influxql, query, write]
|
||||
related:
|
||||
- /influxdb/v2.0/query-data/influxql
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/
|
||||
---
|
||||
|
||||
The InfluxDB v2 API includes InfluxDB 1.x compatibility endpoints that work with
|
||||
|
@ -20,18 +21,23 @@ InfluxDB 1.x client libraries and third-party integrations like [Grafana](https:
|
|||
|
||||
## Authentication
|
||||
InfluxDB 2.0 requires all query and write requests to be authenticated.
|
||||
Use **basic authentication** or **token authentication** to authenticate requests to
|
||||
InfluxDB 1.x compatibility endpoints.
|
||||
Use **1.x-compatible authorizations** or **token authentication** to authenticate
|
||||
requests to InfluxDB 1.x compatibility endpoints.
|
||||
|
||||
### Basic Authentication
|
||||
Basic authentications requires the following credentials:
|
||||
### 1.x-compatible authorizations
|
||||
1.x-compatible authorizations include the following credentials:
|
||||
|
||||
- **username**: InfluxDB username
|
||||
- **password**: InfluxDB [authentication token](/influxdb/v2.0/security/tokens/)
|
||||
|
||||
There are multiple ways to provide basic authentication credentials.
|
||||
For information about creating and managing 1.x-compatible authorizations, see:
|
||||
|
||||
- [influx v1 auth](/influxdb/v2.0/reference/cli/influx/v1/auth/)
|
||||
- [Manually upgrade – 1.x-compatible authorizations](/influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade/#1x-compatible-authorizations)
|
||||
|
||||
There are multiple ways to provide 1.x-compatible authorization credentials to InfluxDB 2.0.
|
||||
The example below uses the `Authorization` header with the `Basic` scheme to
|
||||
provide the required credentials:
|
||||
provide the required 1.x-compatible username and password:
|
||||
|
||||
##### Basic authentication with authorization header
|
||||
```sh
|
||||
|
|
|
@ -9,6 +9,8 @@ menu:
|
|||
weight: 101
|
||||
cascade:
|
||||
related:
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/
|
||||
- /influxdb/v2.0/reference/api/influxdb-1x/
|
||||
- /influxdb/v2.0/reference/cli/influx/#provide-required-authentication-credentials, influx CLI—Provide required authentication credentials
|
||||
- /influxdb/v2.0/reference/cli/influx/#flag-patterns-and-conventions, influx CLI—Flag patterns and conventions
|
||||
---
|
||||
|
|
|
@ -10,7 +10,17 @@ weight: 101
|
|||
influxdb/v2.0/tags: [authorization]
|
||||
---
|
||||
|
||||
The `influx v1 auth` subcommands provide authorization management for the [InfluxDB 1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
The `influx v1 auth` subcommands provide authorization management for the
|
||||
[InfluxDB 1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
|
||||
InfluxDB 2.0 requires authorization with token-based authorization as the standard method.
|
||||
The [1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/) lets clients
|
||||
authenticate with InfluxDB 2.0 using the InfluxDB 1.x convention of username and password.
|
||||
|
||||
{{% note %}}
|
||||
1.x-compatibile authorizations are separate from the credentials used to log
|
||||
into the InfluxDB user interface.
|
||||
{{% /note %}}
|
||||
|
||||
## Usage
|
||||
```
|
||||
|
|
|
@ -84,7 +84,7 @@ To configure Grafana to use InfluxQL with a new install of InfluxDB 2.0, do the
|
|||
|
||||
### Upgraded from InfluxDB 1.x to 2.0
|
||||
To configure Grafana to use InfluxQL when you've upgraded from InfluxDB 1.x to
|
||||
InfluxDB 2.0 (following the [official upgrade](/influxdb/v2.0/upgrade/v1-to-v2/)):
|
||||
InfluxDB 2.0 (following an [official upgrade guide](/influxdb/v2.0/upgrade/v1-to-v2/)):
|
||||
|
||||
1. Authenticate using the _non-admin_ [v1 compatible authentication credentials](#view-and-create-influxdb-v1-authorizations)
|
||||
created during the upgrade process.
|
||||
|
|
|
@ -1,217 +1,28 @@
|
|||
---
|
||||
title: Upgrade from InfluxDB 1.x to InfluxDB 2.0
|
||||
title: Upgrade from InfluxDB 1.x to 2.0
|
||||
description: >
|
||||
Upgrade from InfluxDB 1.x to InfluxDB 2.0.
|
||||
Explore different methods for upgrading from InfluxDB 1.x to InfluxDB 2.0 and
|
||||
choose the best one for your use case.
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
parent: Upgrade InfluxDB
|
||||
name: InfluxDB 1.x to 2.0
|
||||
weight: 10
|
||||
aliases:
|
||||
- /influxdb/v2.0/reference/upgrading/influxd-upgrade-guide/
|
||||
---
|
||||
|
||||
Use the `influxd upgrade` command to upgrade InfluxDB 1.x to InfluxDB 2.0.
|
||||
The `upgrade` command provides an in-place upgrade from InfluxDB 1.x to InfluxDB 2.0.
|
||||
Explore different methods for upgrading from InfluxDB 1.x to InfluxDB 2.0 and
|
||||
determine which best suits your use case.
|
||||
Consider the following:
|
||||
|
||||
{{% note %}}
|
||||
#### Docker users
|
||||
#### Do you want to migrate all your time series data?
|
||||
[Automatically upgrade to InfluxDB 2.0](/influxdb/v2.0/upgrade/v1-to-v2/automatic-upgrade/).
|
||||
|
||||
To upgrade from InfluxDB 1.x to InfluxDB 2.0 using Docker,
|
||||
see [Upgrade from InfluxDB 1.x to 2.0 with Docker](/influxdb/v2.0/upgrade/v1-to-v2/docker/).
|
||||
{{% /note %}}
|
||||
#### Do you want to selectively migrate your time series data?
|
||||
[Manually upgrade to InfluxDB 2.0](/influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade/).
|
||||
|
||||
Specifically, the upgrade process does the following:
|
||||
#### Are you using Docker?
|
||||
[Upgrade to the 2.x Docker image](/influxdb/v2.0/upgrade/v1-to-v2/docker/).
|
||||
|
||||
1. Reads the existing InfluxDB 1.x configuration file and generates an equivalent InfluxDB 2.0 configuration file at `~/.influxdbv2/config.toml` or at a custom path specified with the `--v2-config-path` flag.
|
||||
2. Upgrades metadata and storage engine paths to `~/.influxdbv2/meta` and `~/.influxdbv2/engine`, respectively (unless otherwise specified).
|
||||
3. Writes existing data and write ahead log (WAL) files into InfluxDB 2.0 [buckets](/influxdb/v2.0/reference/glossary/#bucket).
|
||||
4. Creates [database and retention policy (DBRP) mappings](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/) required to query data with InfluxQL.
|
||||
5. Reads existing metadata and migrates non-admin users, passwords, and permissions into a 1.x authorization–compatible store within `~/influxdbv2/influxdb.bolt`.
|
||||
|
||||
When starting InfluxDB 2.0 after running `influxdb upgrade`, InfluxDB must build a new time series index (TSI).
|
||||
Depending on the volume of data present, this may take some time.
|
||||
|
||||
## Before you begin: important considerations
|
||||
|
||||
Before upgrading to InfluxDB 2.0, consider the following guidelines.
|
||||
Some or all might apply to your specific installation and use case.
|
||||
The sections below contain our recommendations for addressing possible gaps in the upgrade process.
|
||||
Consider whether you need to address any of the following before upgrading.
|
||||
|
||||
- [Available operating system, container, and platform support](#available-operating-system-container-and-platform-support)
|
||||
- [Continuous queries](#continuous-queries)
|
||||
- [Supported protocols](#supported-protocols)
|
||||
- [Kapacitor](#kapacitor)
|
||||
- [User migration](#user-migration)
|
||||
- [Dashboards](#dashboards)
|
||||
- [Other data](#other-data)
|
||||
- [Secure by default](#secure-by-default)
|
||||
- [`inmem` indexing option](#inmem-indexing-option)
|
||||
|
||||
### Available operating system, container, and platform support
|
||||
|
||||
{{% warn %}}
|
||||
InfluxDB 2.0 requires 64-bit operating systems.
|
||||
{{% /warn %}}
|
||||
|
||||
InfluxDB 2.0 is currently available for macOS and Linux.
|
||||
Windows builds are not currently available, but are planned for subsequent releases.
|
||||
|
||||
### Continuous queries
|
||||
Continuous queries are replaced by **tasks** in InfluxDB 2.0.
|
||||
By default, `influxd upgrade` writes all continuous queries to `~/continuous_queries.txt`.
|
||||
To convert continuous queries to InfluxDB tasks, see
|
||||
[Migrate continuous queries to tasks](/influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/).
|
||||
|
||||
### Supported protocols
|
||||
|
||||
InfluxDB 2.0 doesn't directly support the alternate write protocols
|
||||
[supported in InfluxDB 1.x](/influxdb/v1.8/supported_protocols/)
|
||||
(CollectD, Graphite, OpenTSDB, Prometheus, UDP).
|
||||
Use [Telegraf](/{{< latest "telegraf" >}}/) to translate these protocols to line protocol.
|
||||
|
||||
### Kapacitor
|
||||
|
||||
You can continue to use Kapacitor with InfluxDB OSS 2.0 under the following scenarios:
|
||||
|
||||
- Kapacitor Batch-style TICKscripts work with the 1.x read compatible API.
|
||||
Existing Kapacitor user credentials should continue to work using the [1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
- InfluxDB 2.0 has no subsriptions API and does not support Kapacitor stream tasks.
|
||||
To continue using stream tasks, write data directly to both InfluxDB and Kapacitor.
|
||||
Use **Telegraf** and its [InfluxDB output plugin](/{{< latest "telegraf" >}}/plugins/#influxdb)
|
||||
to write to Kapacitor and the [InfluxDB v2 output plugin](/{{< latest "telegraf" >}}/plugins/#influxdb_v2) to write to InfluxDB v2.
|
||||
|
||||
##### Example Telegraf configuration
|
||||
```toml
|
||||
# Write to Kapacitor
|
||||
[[outputs.influxdb]]
|
||||
urls = ["http://localhost:9092"]
|
||||
database = "example-db"
|
||||
retention_policy = "example-rp"
|
||||
|
||||
# Write to InfluxDB 2.0
|
||||
[[outputs.influxdb]]
|
||||
urls = ["http://localhost:8086"]
|
||||
database = "example-db"
|
||||
retention_policy = "example-rp"
|
||||
username = "v1-auth-username"
|
||||
password = "v1-auth-password"
|
||||
```
|
||||
|
||||
### User migration
|
||||
|
||||
`influxd upgrade` migrates existing 1.x users and their permissions.
|
||||
However, it *does not migrate administrative users*.
|
||||
|
||||
To review users with admin permissions, in the InfluxDB 1.x CLI, run `show users`.
|
||||
Any users labeled "admin" *will not* be migrated.
|
||||
|
||||
If using an admin user for visualization or Chronograf's administrative functions, create a new read-only user before upgrading.
|
||||
Admin rights are granted to the primary user created in the InfluxDB 2.0 setup process which runs at the end of the upgrade process.
|
||||
This provides you with the opportunity to re-assess who should be granted admin-level access in your InfluxDB 2.0 setup.
|
||||
|
||||
### Dashboards
|
||||
|
||||
You can continue to use your existing dashboards and visualization tools with InfluxDB 2.0 via the [1.x read compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
The upgrade process creates [DBRP mappings](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/) to ensure existing users can execute InfluxQL queries with the appropriate permissions.
|
||||
|
||||
However, if your dashboard tool is configured using a user with admin permissions,
|
||||
you will need to create a new read-only user with the appropriate database permissions *before* upgrading.
|
||||
This new username and password combination should be used within the data source configurations to continue to provide read-only access to the underlying data.
|
||||
|
||||
Ensure your dashboards are all functioning before upgrading.
|
||||
|
||||
### Other data
|
||||
|
||||
The 1.x `_internal` database is not migrated with the `influxd upgrade` command.
|
||||
To collect, store, and monitor similar internal InfluxDB metrics,
|
||||
[create an InfluxDB 2.0 scraper](/influxdb/v2.0/write-data/no-code/scrape-data/manage-scrapers/create-a-scraper/)
|
||||
to scrape data from the `/metrics` endpoint and store them in a bucket.
|
||||
|
||||
### Secure by default
|
||||
|
||||
InfluxDB 2.0 requires authentication and does not support the InfluxDB 1.x `auth-enabled = false` configuration option.
|
||||
|
||||
Before upgrading to 2.0, [enable authentication in your InfluxDB 1.x instance](/influxdb/v1.8/administration/authentication_and_authorization/#set-up-authentication)
|
||||
and test your credentials to ensure your applications, agents, and visualization tools can connect to InfluxDB.
|
||||
|
||||
If you upgrade with `auth-enabled = false`, the upgrade may appear complete,
|
||||
but client requests to InfluxDB 2.0 may be silently ignored (you won't see a notification the request was denied).
|
||||
|
||||
### In-memory indexing option
|
||||
|
||||
InfluxDB 2.0 doesn't support [in-memory (`inmem`) indexing](/influxdb/v1.8/administration/config/#in-memory-inmem-index-settings). The following InfluxDB 1.x configuration options associated with `inmem` indexing are ignored in the upgrade process:
|
||||
|
||||
- `max-series-per-database`
|
||||
- `max-values-per-tag`
|
||||
|
||||
|
||||
## Perform the upgrade
|
||||
|
||||
If you've considered the [guidance above](#before-you-begin-important-considerations)
|
||||
and are ready to proceed, follow these steps to upgrade your InfluxDB 1.x to InfluxDB 2.0.
|
||||
|
||||
1. [Download InfluxDB OSS 2.0](https://portal.influxdata.com/downloads/).
|
||||
Unpackage the InfluxDB binaries and place them in your `$PATH`.
|
||||
2. Stop your running InfluxDB 1.x instance.
|
||||
Make a backup copy of all 1.x data before upgrading:
|
||||
|
||||
```sh
|
||||
cp -R .influxdb/ .influxdb_bak/
|
||||
```
|
||||
3. Use `influxd version` to ensure you are running InfluxDB 2.0 from the command line.
|
||||
The `influxd upgrade` command is only available in InfluxDB 2.0.
|
||||
4. If your 1.x configuration file is at the [default location](/influxdb/v1.8/administration/config/#using-the-configuration-file), run:
|
||||
|
||||
```sh
|
||||
influxd upgrade
|
||||
```
|
||||
|
||||
If your 1.x configuration file is not at the default location, run:
|
||||
|
||||
```sh
|
||||
influxd upgrade --config-file <path to v1 config file>
|
||||
```
|
||||
|
||||
To store the upgraded 2.0 configuration file in a custom location, include the `--v2-config-path` flag:
|
||||
|
||||
```sh
|
||||
influxd upgrade --v2-config-path <destination path for v2 config file>
|
||||
```
|
||||
|
||||
5. Follow the prompts to set up a new InfluxDB 2.0 instance.
|
||||
|
||||
```
|
||||
Welcome to InfluxDB 2.0 upgrade!
|
||||
Please type your primary username: <your-username>
|
||||
|
||||
Please type your password:
|
||||
|
||||
Please type your password again:
|
||||
|
||||
Please type your primary organization name: <your-org>
|
||||
|
||||
Please type your primary bucket name: <your-bucket>
|
||||
|
||||
Please type your retention period in hours.
|
||||
Or press ENTER for infinite:
|
||||
|
||||
You have entered:
|
||||
Username: <your-username>
|
||||
Organization: <your-org>
|
||||
Bucket: <your-bucket>
|
||||
Retention Period: infinite
|
||||
Confirm? (y/n): y
|
||||
```
|
||||
|
||||
The output of the upgrade prints to standard output.
|
||||
It is also saved (for troubleshooting and debugging) in the current directory to a file called `upgrade.log` located in the home directory of the user running `influxdb upgrade`.
|
||||
|
||||
### Post-upgrade
|
||||
|
||||
To verify 1.x users were successfully migrated to 2.0, run [`influx v1 auth list`](/influxdb/v2.0/reference/cli/influx/v1/auth/list/).
|
||||
|
||||
## Further reading
|
||||
|
||||
For more information on upgrading, see the [`influxd upgrade` reference documentation](/influxdb/v2.0/reference/cli/influxd/upgrade/).
|
||||
#### Are you using continuous queries (CQs)?
|
||||
After you upgrade (automatically, manually, or using Docker),
|
||||
[migrate your 1.x CQs to InfluxDB 2.0 tasks](/influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/).
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
---
|
||||
title: Automatically upgrade from InfluxDB 1.x to 2.0
|
||||
list_title: Automatically upgrade from 1.x to 2.0
|
||||
description: >
|
||||
Use the `influx upgrade` tool to automatically upgrade from InfluxDB 1.x to InfluxDB 2.0.
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
parent: InfluxDB 1.x to 2.0
|
||||
name: Automatically upgrade
|
||||
weight: 10
|
||||
aliases:
|
||||
- /influxdb/v2.0/reference/upgrading/influxd-upgrade-guide/
|
||||
related:
|
||||
- /influxdb/v2.0/reference/cli/influxd/upgrade/
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade/
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/docker/
|
||||
---
|
||||
|
||||
Use the `influxd upgrade` command to upgrade InfluxDB 1.x to InfluxDB 2.0.
|
||||
The `upgrade` command provides an in-place upgrade from InfluxDB 1.x to InfluxDB 2.0.
|
||||
|
||||
Specifically, the upgrade process does the following:
|
||||
|
||||
1. Reads the existing InfluxDB 1.x configuration file and generates an equivalent InfluxDB 2.0 configuration file at `~/.influxdbv2/config.toml` or at a custom path specified with the `--v2-config-path` flag.
|
||||
2. Upgrades metadata and storage engine paths to `~/.influxdbv2/meta` and `~/.influxdbv2/engine`, respectively (unless otherwise specified).
|
||||
3. Writes existing data and write ahead log (WAL) files into InfluxDB 2.0 [buckets](/influxdb/v2.0/reference/glossary/#bucket).
|
||||
4. Creates [database and retention policy (DBRP) mappings](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/) required to query data with InfluxQL.
|
||||
5. Reads existing metadata and migrates non-admin users, passwords, and permissions into a 1.x authorization–compatible store within `~/influxdbv2/influxdb.bolt`.
|
||||
|
||||
When starting InfluxDB 2.0 after running `influxdb upgrade`, InfluxDB must build a new time series index (TSI).
|
||||
Depending on the volume of data present, this may take some time.
|
||||
|
||||
## Important considerations before you begin
|
||||
|
||||
Before upgrading to InfluxDB 2.0, consider the following guidelines.
|
||||
Some or all might apply to your specific installation and use case.
|
||||
The sections below contain our recommendations for addressing possible gaps in the upgrade process.
|
||||
Consider whether you need to address any of the following before upgrading.
|
||||
|
||||
- [Available operating system, container, and platform support](#available-operating-system-container-and-platform-support)
|
||||
- [Continuous queries](#continuous-queries)
|
||||
- [Supported protocols](#supported-protocols)
|
||||
- [Kapacitor](#kapacitor)
|
||||
- [User migration](#user-migration)
|
||||
- [Dashboards](#dashboards)
|
||||
- [Other data](#other-data)
|
||||
- [Secure by default](#secure-by-default)
|
||||
- [`inmem` indexing option](#inmem-indexing-option)
|
||||
|
||||
### Available operating system, container, and platform support
|
||||
|
||||
InfluxDB 2.0 is currently available for macOS and Linux.
|
||||
Windows builds are not currently available, but are planned for subsequent releases.
|
||||
|
||||
{{% note %}}
|
||||
InfluxDB 2.0 requires 64-bit operating systems.
|
||||
{{% /note %}}
|
||||
|
||||
### Continuous queries
|
||||
|
||||
Continuous queries are replaced by **tasks** in InfluxDB 2.0.
|
||||
By default, `influxd upgrade` writes all continuous queries to `~/continuous_queries.txt`.
|
||||
To convert continuous queries to InfluxDB tasks, see
|
||||
[Migrate continuous queries to tasks](/influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/).
|
||||
|
||||
### Supported protocols
|
||||
|
||||
InfluxDB 2.0 doesn't directly support the alternate write protocols
|
||||
[supported in InfluxDB 1.x](/influxdb/v1.8/supported_protocols/)
|
||||
(CollectD, Graphite, OpenTSDB, Prometheus, UDP).
|
||||
Use [Telegraf](/{{< latest "telegraf" >}}/) to translate these protocols to line protocol.
|
||||
|
||||
### Kapacitor
|
||||
|
||||
You can continue to use Kapacitor with InfluxDB OSS 2.0 under the following scenarios:
|
||||
|
||||
- Kapacitor Batch-style TICKscripts work with the 1.x read compatible API.
|
||||
Existing Kapacitor user credentials should continue to work using the [1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
- InfluxDB 2.0 has no subscriptions API and does not support Kapacitor stream tasks.
|
||||
To continue using stream tasks, write data directly to both InfluxDB and Kapacitor.
|
||||
Use **Telegraf** and its [InfluxDB output plugin](/{{< latest "telegraf" >}}/plugins/#influxdb)
|
||||
to write to Kapacitor and the [InfluxDB v2 output plugin](/{{< latest "telegraf" >}}/plugins/#influxdb_v2) to write to InfluxDB v2.
|
||||
|
||||
##### Example Telegraf configuration
|
||||
```toml
|
||||
# Write to Kapacitor
|
||||
[[outputs.influxdb]]
|
||||
urls = ["http://localhost:9092"]
|
||||
database = "example-db"
|
||||
retention_policy = "example-rp"
|
||||
|
||||
# Write to InfluxDB 2.0
|
||||
[[outputs.influxdb]]
|
||||
urls = ["http://localhost:8086"]
|
||||
database = "example-db"
|
||||
retention_policy = "example-rp"
|
||||
username = "v1-auth-username"
|
||||
password = "v1-auth-password"
|
||||
```
|
||||
|
||||
### User migration
|
||||
|
||||
`influxd upgrade` migrates existing 1.x users and their permissions.
|
||||
However, it *does not migrate administrative users*.
|
||||
|
||||
To review users with admin permissions, in the InfluxDB 1.x CLI, run `show users`.
|
||||
Any users labeled "admin" *will not* be migrated.
|
||||
|
||||
If using an admin user for visualization or Chronograf administrative functions,
|
||||
create a new read-only user before upgrading.
|
||||
Admin rights are granted to the primary user created in the InfluxDB 2.0 setup
|
||||
process which runs at the end of the upgrade process.
|
||||
This provides you with the opportunity to re-assess who should be granted
|
||||
admin-level access in your InfluxDB 2.0 setup.
|
||||
|
||||
### Dashboards
|
||||
|
||||
You can continue to use your existing dashboards and visualization tools with InfluxDB 2.0 via the [1.x read compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/).
|
||||
The upgrade process creates [DBRP mappings](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/) to ensure existing users can execute InfluxQL queries with the appropriate permissions.
|
||||
|
||||
However, if your dashboard tool is configured using a user with admin permissions,
|
||||
you will need to create a new read-only user with the appropriate database permissions *before* upgrading.
|
||||
This new username and password combination should be used within the data source configurations to continue to provide read-only access to the underlying data.
|
||||
|
||||
Ensure your dashboards are all functioning before upgrading.
|
||||
|
||||
### Other data
|
||||
|
||||
The 1.x `_internal` database is not migrated with the `influxd upgrade` command.
|
||||
To collect, store, and monitor similar internal InfluxDB metrics,
|
||||
[create an InfluxDB 2.0 scraper](/influxdb/v2.0/write-data/no-code/scrape-data/manage-scrapers/create-a-scraper/)
|
||||
to scrape data from the `/metrics` endpoint and store them in a bucket.
|
||||
|
||||
### Secure by default
|
||||
|
||||
InfluxDB 2.0 requires authentication and does not support the InfluxDB 1.x `auth-enabled = false` configuration option.
|
||||
|
||||
Before upgrading to 2.0, [enable authentication in your InfluxDB 1.x instance](/influxdb/v1.8/administration/authentication_and_authorization/#set-up-authentication)
|
||||
and test your credentials to ensure your applications, agents, and visualization tools can connect to InfluxDB.
|
||||
|
||||
If you upgrade with `auth-enabled = false`, the upgrade may appear complete,
|
||||
but client requests to InfluxDB 2.0 may be silently ignored (you won't see a notification the request was denied).
|
||||
|
||||
### In-memory indexing option
|
||||
|
||||
InfluxDB 2.0 doesn't support [in-memory (`inmem`) indexing](/influxdb/v1.8/administration/config/#in-memory-inmem-index-settings). The following InfluxDB 1.x configuration options associated with `inmem` indexing are ignored in the upgrade process:
|
||||
|
||||
- `max-series-per-database`
|
||||
- `max-values-per-tag`
|
||||
|
||||
## Perform the upgrade
|
||||
|
||||
If you've considered the [guidance above](#before-you-begin-important-considerations)
|
||||
and are ready to proceed, follow these steps to upgrade your InfluxDB 1.x to InfluxDB 2.0.
|
||||
|
||||
1. [Download InfluxDB OSS 2.0](https://portal.influxdata.com/downloads/).
|
||||
Unpackage the InfluxDB binaries and place them in your `$PATH`.
|
||||
2. Stop your running InfluxDB 1.x instance.
|
||||
Make a backup copy of all 1.x data before upgrading:
|
||||
|
||||
```sh
|
||||
cp -R .influxdb/ .influxdb_bak/
|
||||
```
|
||||
3. Use `influxd version` to ensure you are running InfluxDB 2.0 from the command line.
|
||||
The `influxd upgrade` command is only available in InfluxDB 2.0.
|
||||
4. If your 1.x configuration file is at the [default location](/influxdb/v1.8/administration/config/#using-the-configuration-file), run:
|
||||
|
||||
```sh
|
||||
influxd upgrade
|
||||
```
|
||||
|
||||
If your 1.x configuration file is not at the default location, run:
|
||||
|
||||
```sh
|
||||
influxd upgrade --config-file <path to v1 config file>
|
||||
```
|
||||
|
||||
To store the upgraded 2.0 configuration file in a custom location, include the `--v2-config-path` flag:
|
||||
|
||||
```sh
|
||||
influxd upgrade --v2-config-path <destination path for v2 config file>
|
||||
```
|
||||
|
||||
5. Follow the prompts to set up a new InfluxDB 2.0 instance.
|
||||
|
||||
```
|
||||
Welcome to InfluxDB 2.0 upgrade!
|
||||
Please type your primary username: <your-username>
|
||||
|
||||
Please type your password:
|
||||
|
||||
Please type your password again:
|
||||
|
||||
Please type your primary organization name: <your-org>
|
||||
|
||||
Please type your primary bucket name: <your-bucket>
|
||||
|
||||
Please type your retention period in hours.
|
||||
Or press ENTER for infinite:
|
||||
|
||||
You have entered:
|
||||
Username: <your-username>
|
||||
Organization: <your-org>
|
||||
Bucket: <your-bucket>
|
||||
Retention Period: infinite
|
||||
Confirm? (y/n): y
|
||||
```
|
||||
|
||||
The output of the upgrade prints to standard output.
|
||||
It is also saved (for troubleshooting and debugging) in the current directory to a file called `upgrade.log` located in the home directory of the user running `influxdb upgrade`.
|
||||
|
||||
## Post-upgrade
|
||||
|
||||
### Verify 1.x users were migrated to 2.0
|
||||
|
||||
To verify 1.x users were successfully migrated to 2.0, run
|
||||
[`influx v1 auth list`](/influxdb/v2.0/reference/cli/influx/v1/auth/list/).
|
||||
|
||||
#### Add authorizations for external clients
|
||||
|
||||
If your InfluxDB 1.x instance **did not have authentication enabled** and the
|
||||
`influx v1 auth list` doesn't return any users, external clients connected to
|
||||
your 1.x instance will not be able to access InfluxDB 2.0, which requires authentication.
|
||||
|
||||
**For these external clients to work with InfluxDB 2.0:**
|
||||
|
||||
1. [Manually create a 1.x-compatible authorization](/influxdb/v2.0/upgrade/v1-to-v2/manual-upgrade/#create-a-1x-compatible-authorization).
|
||||
2. Update the client configuration to use the username and password associated
|
||||
with your 1.x-compatible authorization.
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Upgrade from InfluxDB 1.x to 2.0 with Docker
|
||||
list_title: Upgrade from 1.x to 2.0 with Docker
|
||||
description: >
|
||||
Use the automated upgrade process built into the InfluxDB 2.x Docker image to
|
||||
update InfluxDB 1.x Docker deployments to InfluxDB 2.x.
|
||||
|
@ -42,7 +43,7 @@ the upgrade won't run if an existing boltdb file is found at the
|
|||
{{% /note %}}
|
||||
|
||||
Find more information about the automated InfluxDB upgrade process,
|
||||
see [Upgrade from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/).
|
||||
see [Automatically upgrade from InfluxDB 1.x to 2.0](/influxdb/v2.0/upgrade/v1-to-v2/automatic-upgrade/).
|
||||
|
||||
### InfluxDB 2.x initialization credentials
|
||||
The automated InfluxDB upgrade process bootstraps an initial admin user,
|
||||
|
|
|
@ -0,0 +1,339 @@
|
|||
---
|
||||
title: Manually upgrade from InfluxDB 1.x to 2.0
|
||||
list_title: Manually upgrade from 1.x to 2.0
|
||||
description: >
|
||||
To manually upgrade from InfluxDB 1.x to InfluxDB 2.0, migrate data, create
|
||||
1.x-compatible authorizations, and create database and retention policy
|
||||
(DBRP) mappings.
|
||||
menu:
|
||||
influxdb_2_0:
|
||||
parent: InfluxDB 1.x to 2.0
|
||||
name: Manually upgrade
|
||||
weight: 11
|
||||
related:
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/
|
||||
- /influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/
|
||||
---
|
||||
|
||||
To manually upgrade from InfluxDB 1.x to InfluxDB 2.0:
|
||||
|
||||
1. [Install InfluxDB 2.0](#install-influxdb-20)
|
||||
2. [Migrate custom configuration settings](#migrate-custom-configuration-settings)
|
||||
3. [Create DBRP mappings](#create-dbrp-mappings)
|
||||
4. [Create authorizations](#create-authorizations)
|
||||
5. [Migrate time series data](#migrate-time-series-data)
|
||||
6. [Migrate continuous queries](#migrate-continuous-queries)
|
||||
|
||||
## Install InfluxDB 2.0
|
||||
[Download, install, and set up InfluxDB 2.0](/influxdb/v2.0/get-started/).
|
||||
|
||||
{{% note %}}
|
||||
#### Required 2.x credentials
|
||||
All InfluxDB 2.0 `influx` CLI examples below assume the required **host**,
|
||||
**organization**, and **authentication token** credentials are provided by your
|
||||
[`influx` CLI configuration](/influxdb/v2.0/reference/cli/influx/#provide-required-authentication-credentials).
|
||||
{{% /note %}}
|
||||
|
||||
## 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.0 configuration settings:
|
||||
|
||||
{{< expand-wrapper >}}
|
||||
{{% expand "View configuration option parity" %}}
|
||||
|
||||
| 1.x configuration option | 2.0 configuration option |
|
||||
|:-------------- |:------------------------ |
|
||||
| **[data]** | |
|
||||
| dir | [engine-path](/influxdb/v2.0/reference/config-options/#engine-path) |
|
||||
| wal-dir | [engine-path](/influxdb/v2.0/reference/config-options/#engine-path) |
|
||||
| wal-fsync-delay | [storage-wal-fsync-delay](/influxdb/v2.0/reference/config-options/#storage-wal-fsync-delay) |
|
||||
| index-version | |
|
||||
| trace-logging-enabled | |
|
||||
| query-log-enabled | |
|
||||
| strict-error-handling | |
|
||||
| validate-keys | [storage-validate-keys](/influxdb/v2.0/reference/config-options/#storage-validate-keys) |
|
||||
| cache-max-memory-size | [storage-cache-max-memory-size](/influxdb/v2.0/reference/config-options/#storage-cache-max-memory-size) |
|
||||
| cache-snapshot-memory-size | [storage-cache-snapshot-memory-size](/influxdb/v2.0/reference/config-options/#storage-cache-snapshot-memory-size) |
|
||||
| cache-snapshot-write-cold-duration | [storage-cache-snapshot-write-cold-duration](/influxdb/v2.0/reference/config-options/#storage-cache-snapshot-write-cold-duration) |
|
||||
| compact-full-write-cold-duration | [storage-compact-full-write-cold-duration](/influxdb/v2.0/reference/config-options/#storage-compact-full-write-cold-duration) |
|
||||
| max-concurrent-compactions | [storage-max-concurrent-compactions](/influxdb/v2.0/reference/config-options/#storage-max-concurrent-compactions) |
|
||||
| compact-throughput | |
|
||||
| compact-throughput-burst | [storage-compact-throughput-burst](/influxdb/v2.0/reference/config-options/#storage-compact-throughput-burst) |
|
||||
| tsm-use-madv-willneed | [storage-tsm-use-madv-willneed](/influxdb/v2.0/reference/config-options/#storage-tsm-use-madv-willneed) |
|
||||
| max-series-per-database | |
|
||||
| max-values-per-tag | |
|
||||
| max-index-log-file-size | [storage-max-index-log-file-size](/influxdb/v2.0/reference/config-options/#storage-max-index-log-file-size) |
|
||||
| series-id-set-cache-size | [storage-series-id-set-cache-size](/influxdb/v2.0/reference/config-options/#storage-series-id-set-cache-size) |
|
||||
| | |
|
||||
| **[retention]** | |
|
||||
| check-interval | [storage-retention-check-interval](/influxdb/v2.0/reference/config-options/#storage-retention-check-interval) |
|
||||
| | |
|
||||
| **[shard-precreation]** | |
|
||||
| check-interval | [storage-shard-precreator-check-interval](/influxdb/v2.0/reference/config-options/#storage-shard-precreator-check-interval) |
|
||||
| advance-period | [storage-shard-precreator-advance-period](/influxdb/v2.0/reference/config-options/#storage-shard-precreator-advance-period) |
|
||||
| | |
|
||||
| **[http]** | |
|
||||
| flux-enabled | |
|
||||
| flux-log-enabled | |
|
||||
| bind-address | [http-bind-address](/influxdb/v2.0/reference/config-options/#http-bind-address) |
|
||||
| auth-enabled | |
|
||||
| realm | |
|
||||
| log-enabled | |
|
||||
| suppress-write-log | |
|
||||
| access-log-path | |
|
||||
| access-log-status-filters | |
|
||||
| write-tracing | |
|
||||
| pprof-enabled | |
|
||||
| pprof-auth-enabled | |
|
||||
| debug-pprof-enabled | |
|
||||
| ping-auth-enabled | |
|
||||
| https-enabled | |
|
||||
| https-certificate | [tls-cert](/influxdb/v2.0/reference/config-options/#tls-cert) |
|
||||
| https-private-key | [tls-key](/influxdb/v2.0/reference/config-options/#tls-key) |
|
||||
| shared-secret | |
|
||||
| max-row-limit | |
|
||||
| max-connection-limit | |
|
||||
| unix-socket-enabled | |
|
||||
| bind-socket | |
|
||||
| max-body-size | |
|
||||
| max-concurrent-write-limit | |
|
||||
| max-enqueued-write-limit | |
|
||||
| enqueued-write-timeout | |
|
||||
| | |
|
||||
| **[logging]** | |
|
||||
| format | |
|
||||
| level | [log-level](/influxdb/v2.0/reference/config-options/#log-level) |
|
||||
| suppress-logo | |
|
||||
| | |
|
||||
| **[tls]** | |
|
||||
| ciphers | [tls-strict-ciphers](/influxdb/v2.0/reference/config-options/#tls-strict-ciphers) |
|
||||
| min-version | [tls-min-version](/influxdb/v2.0/reference/config-options/#tls-min-version) |
|
||||
| max-version | |
|
||||
|
||||
{{% note %}}
|
||||
#### 1.x configuration groups not in 2.0
|
||||
The following 1.x configuration groups **do not** apply to InfluxDB 2.0:
|
||||
|
||||
- meta
|
||||
- coordinator
|
||||
- monitor
|
||||
- subscriber
|
||||
- graphite
|
||||
- collectd
|
||||
- opentsdb
|
||||
- udp
|
||||
- continuous_queries
|
||||
{{% /note %}}
|
||||
{{% /expand %}}
|
||||
{{< /expand-wrapper >}}
|
||||
|
||||
2. Apply your 1.x custom settings to the comparable InfluxDB 2.0 settings using
|
||||
`influxd` flags, environment variables, or a 2.0 configuration file.
|
||||
For more information about configuring InfluxDB 2.0, see
|
||||
[Configuration options](/influxdb/v2.0/reference/config-options/).
|
||||
3. **Restart `influxd`**.
|
||||
|
||||
## Create DBRP mappings
|
||||
InfluxDB database and retention policy (DBRP) mappings associate database and
|
||||
retention policy combinations with InfluxDB 2.0 [buckets](/influxdb/v2.0/reference/glossary/#bucket).
|
||||
These mappings allow InfluxDB 1.x clients to successfully query and write to
|
||||
InfluxDB 2.0 buckets while using the 1.x DBRP convention.
|
||||
|
||||
_For more information about DBRP mapping, see
|
||||
[Database and retention policy mapping](/influxdb/v2.0/reference/api/influxdb-1x/dbrp/)._
|
||||
|
||||
**To map a DBRP combination to an InfluxDB 2.0 bucket:**
|
||||
|
||||
1. **Create a bucket**
|
||||
[Create an InfluxDB 2.0 bucket](/influxdb/v2.0/organizations/buckets/create-bucket/).
|
||||
We recommend creating a bucket for each unique 1.x database and retention
|
||||
policy combination using the following naming convention:
|
||||
|
||||
```sh
|
||||
# Naming convention
|
||||
db-name/rp-name
|
||||
|
||||
# Example
|
||||
telegraf/autogen
|
||||
```
|
||||
|
||||
2. **Create a DBRP mapping**
|
||||
Use the [`influx v1 dbrp create` command](/influxdb/v2.0/reference/cli/influx/v1/dbrp/create/)
|
||||
command to create a DBRP mapping.
|
||||
Provide the following:
|
||||
|
||||
- database name
|
||||
- retention policy name _(not retention period)_
|
||||
- [bucket ID](/influxdb/v2.0/organizations/buckets/view-buckets/)
|
||||
- _(optional)_ `--default` flag if you want the retention policy to be the default retention
|
||||
policy for the specified database
|
||||
|
||||
{{< code-tabs-wrapper >}}
|
||||
{{% code-tabs %}}
|
||||
[DB with one RP](#)
|
||||
[DB with multiple RPs](#)
|
||||
{{% /code-tabs %}}
|
||||
{{% code-tab-content %}}
|
||||
```sh
|
||||
influx v1 dbrp create \
|
||||
--db example-db \
|
||||
--rp example-rp \
|
||||
--bucket-id 00xX00o0X001 \
|
||||
--default
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{% code-tab-content %}}
|
||||
```sh
|
||||
# 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
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
|
||||
3. **Confirm the DBRP mapping was created**
|
||||
Use the [`influx v1 dbrp list`](/influxdb/v2.0/reference/cli/influx/v1/dbrp/list/) to list existing DBRP mappings.
|
||||
|
||||
```sh
|
||||
influx v1 dbrp list
|
||||
```
|
||||
|
||||
For information about managing DBRP mappings, see the
|
||||
[`influx v1 dbrp` command documentation](/influxdb/v2.0/reference/cli/influx/v1/dbrp/).
|
||||
|
||||
## Create authorizations
|
||||
InfluxDB 2.0 requires authentication and provides two authentication methods:
|
||||
|
||||
- [Token authentication](#token-authentication)
|
||||
- [1.x compatible authorizations](#1x-compatible-authorizations)
|
||||
|
||||
### Token authentication
|
||||
Use [InfluxDB 2.0 token authentication](/influxdb/v2.0/security/tokens/) to
|
||||
authenticate requests to InfluxDB 2.0.
|
||||
|
||||
##### Recommended if:
|
||||
- Your 1.x instance **does not have authentication enabled**.
|
||||
|
||||
{{% note %}}
|
||||
#### 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.
|
||||
{{% /note %}}
|
||||
|
||||
### 1.x-compatible authorizations
|
||||
InfluxDB 2.0 provides a [1.x compatibility API](/influxdb/v2.0/reference/api/influxdb-1x/)
|
||||
that lets you authenticate using a username and password as in InfluxDB 1.x.
|
||||
If authentication is enabled in your InfluxDB 1.x instance,
|
||||
[create a 1.x-compatible authorization](#create-a-1x-compatible-authorization)
|
||||
with the same username and password as your InfluxDB 1.x instance to allow
|
||||
external clients to connect to your InfluxDB 2.0 instance without any change.
|
||||
|
||||
##### Recommended if:
|
||||
- Your 1.x instance **has authentication enabled**.
|
||||
- You're using **InfluxDB 1.x clients or client libraries** configured with
|
||||
InfluxDB usernames and passwords.
|
||||
|
||||
{{% note %}}
|
||||
1.x compatibility authorizations are separate from credentials used to log
|
||||
into the InfluxDB 2.0 user interface (UI).
|
||||
{{% /note %}}
|
||||
|
||||
#### Create a 1.x-compatible authorization
|
||||
Use the InfluxDB 2.0 [`influx v1 auth create` command](/influxdb/v2.0/reference/cli/influx/v1/auth/create/)
|
||||
to create a 1.x-compatible authorization that grants read/write permissions to specific 2.0 buckets.
|
||||
Provide the following:
|
||||
|
||||
- list of [bucket IDs](/influxdb/v2.0/organizations/buckets/view-buckets/) to
|
||||
grant read or write permissions to
|
||||
- new v1 auth username
|
||||
- new v1 auth password _(when prompted)_
|
||||
|
||||
{{< code-tabs-wrapper >}}
|
||||
{{% code-tabs %}}
|
||||
[Single bucket](#)
|
||||
[Mutiple buckets](#)
|
||||
{{% /code-tabs %}}
|
||||
{{% code-tab-content %}}
|
||||
```sh
|
||||
influx v1 auth create \
|
||||
--read-bucket 00xX00o0X001 \
|
||||
--write-bucket 00xX00o0X001 \
|
||||
--username example-user
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{% code-tab-content %}}
|
||||
```sh
|
||||
influx v1 auth create \
|
||||
--read-bucket 00xX00o0X001 \
|
||||
--read-bucket 00xX00o0X002 \
|
||||
--write-bucket 00xX00o0X001 \
|
||||
--write-bucket 00xX00o0X002 \
|
||||
--username example-user
|
||||
```
|
||||
{{% /code-tab-content %}}
|
||||
{{< /code-tabs-wrapper >}}
|
||||
|
||||
For information about managing 1.x compatible authorizations, see the
|
||||
[`influx v1 auth` command documentation](/influxdb/v2.0/reference/cli/influx/v1/auth/).
|
||||
|
||||
## Migrate time series data
|
||||
To migrate time series data from your InfluxDB 1.x instance to InfluxDB 2.0:
|
||||
|
||||
1. Use the **InfluxDB 1.x** [`influx_inspect export` command](/{{< latest "influxdb" "v1" >}}/tools/influx_inspect/#export)
|
||||
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 2.0 bucket._
|
||||
|
||||
```sh
|
||||
# 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 2.0** [`influx write` command](/influxdb/v2.0/reference/cli/influx/write/)
|
||||
to write the exported line protocol to InfluxDB 2.0.
|
||||
|
||||
```sh
|
||||
# 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 this process for each bucket.
|
||||
|
||||
## Migrate continuous queries
|
||||
For information about migrating InfluxDB 1.x continuous queries to InfluxDB 2.0 tasks,
|
||||
see [Migrate continuous queries to tasks](/influxdb/v2.0/upgrade/v1-to-v2/migrate-cqs/).
|
Loading…
Reference in New Issue