fix(v1): Describe import file sections, note DDL as optional, fix links.

pull/5692/head
Jason Stirnaman 2024-12-02 14:26:18 -06:00
parent 71badd77dc
commit 23e6a4fc86
5 changed files with 40 additions and 23 deletions

View File

@ -24,8 +24,8 @@ You can use these tools in your back up and restore procedures to:
Depending on the volume of data to be protected and your application requirements, InfluxDB Enterprise offers two methods, described below, for managing backups and restoring data:
- [Backup and restore utilities](#backup-and-restore-utilities) — For most applications
- [Exporting and importing data](#exporting-and-importing-data) — For large datasets
- [Backup and restore utilities](#backup-and-restore-utilities): Use for most applications
- [Exporting and importing data](#exporting-and-importing-data): Use for very large datasets and to debug data
> [!Note]
> #### Back up and restore between InfluxDB Enterprise and OSS
@ -545,7 +545,13 @@ For details on optional settings and usage, see [`influx_inspect export` command
### Importing data
After exporting the data in line protocol format, you can import the data using the [`influx -import` CLI command](/enterprise_influxdb/v1/tools/influx-cli/use-influx/#import-data-from-a-file).
To import line protocol data from a file, use the [`influx -import` CLI command](/enterprise_influxdb/v1/tools/influx-cli/use-influx-cli/#influx-arguments).
In your import file, include the following sections:
- _Optional_: **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/enterprise_influxdb/v1/query_language/manage-database/) for creating the relevant [database](/enterprise_influxdb/v1/concepts/glossary/#database) and managing the [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
If your database and retention policy already exist, your file can skip this section.
- **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/enterprise_influxdb/v1/concepts/glossary/#influxdb-line-protocol).
In the following example, the compressed data file (in GNU zip format) is imported into the database
specified in the file's `DML` metadata.
@ -554,7 +560,7 @@ specified in the file's `DML` metadata.
influx -import -path -compressed
```
For details on using the `influx -import` command, see [Import data from a file with `-import`](/enterprise_influxdb/v1/tools/influx-cli/use-influx/#import-data-from-a-file).
For details on using the `influx -import` command, see [Import data from a file](/enterprise_influxdb/v1/tools/influx-cli/use-influx-cli/#import-data-from-a-file).
### Example: export and import for disaster recovery

View File

@ -265,16 +265,17 @@ $ influx -format=json -pretty
### Import data from a file
The import file has two sections:
An import file has two sections:
* **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/enterprise_influxdb/v1/query_language/manage-database/) for creating the relevant [database](/enterprise_influxdb/v1/concepts/glossary/) and managing the [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
- _Optional_: **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/enterprise_influxdb/v1/query_language/manage-database/) for creating the relevant [database](/enterprise_influxdb/v1/concepts/glossary/) and managing the [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
If your database and retention policy already exist, your file can skip this section.
* **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/enterprise_influxdb/v1/concepts/glossary/#influxdb-line-protocol).
- **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/enterprise_influxdb/v1/concepts/glossary/#influxdb-line-protocol).
Example:
#### Example: import data from a file
File (`datarrr.txt`):
```
The following `datarrr.txt` file is output using the [`influx_inspect export` command](/enterprise_influxdb/v1/tools/influx_inspect#export):
```text
# DDL
CREATE DATABASE pirates
CREATE RETENTION POLICY oneday ON pirates DURATION 1d REPLICATION 1
@ -290,13 +291,17 @@ treasures,captain_id=tetra value=47 1439856000
treasures,captain_id=crunch value=109 1439858880
```
Command:
```
To import the file, enter the following command in your terminal:
```bash
influx -import -path=datarrr.txt -precision=s
```
Results:
```
The data is imported into the database and retention policy specified in the `# DML`
context metadata.
The output is the following:
```text
2015/12/22 12:25:06 Processed 2 commands
2015/12/22 12:25:06 Processed 5 inserts
2015/12/22 12:25:06 Failed 0 inserts
@ -309,7 +314,7 @@ Results:
> Time elapsed: 56.740578415s.
> Points per second (PPS): 54634
Things to note about `-import`:
Keep the following in mind when using `-import`:
- To throttle the import, use `-pps` to set the number of points per second to ingest. By default, pps is zero and `influx` does not throttle importing.
- To import a file compressed with `gzip` (GNU zip), include the -compressed flag.

View File

@ -22,7 +22,7 @@ You can use these tools in your back up and restore procedures to:
- Provide disaster recovery due to unexpected events
- Migrate data to new environments or servers
- Restore instances to a consistent state
- Export and import data for debugging
- Export and import data for debugging
Depending on the volume of data to be protected and your application requirements, InfluxDB OSS {{< current-version >}} offers two methods, described below, for managing backups and restoring data:
@ -744,7 +744,13 @@ For details on optional settings and usage, see [`influx_inspect export` command
### Importing data
After exporting the data in line protocol format, you can import the data using the [`influx -import` CLI command](/influxdb/v1/tools/influx-cli/use-influx/#import-data-from-a-file).
To import line protocol data from a file, use the [`influx -import` CLI command](/influxdb/v1/tools/influx-cli/use-influx-cli/#influx-arguments).
In your import file, include the following sections:
- _Optional_: **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/influxdb/v1/query_language/manage-database/) for creating the relevant [database](/influxdb/v1/concepts/glossary/#database) and managing the [retention policy](/influxdb/v1/concepts/glossary/#retention-policy-rp).
If your database and retention policy already exist, your file can skip this section.
- **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/influxdb/v1/concepts/glossary/#influxdb-line-protocol).
In the following example, the compressed data file (in GNU zip format) is imported into the database
specified in the file's `DML` metadata.
@ -753,9 +759,9 @@ specified in the file's `DML` metadata.
influx -import -path -compressed
```
For details on using the `influx -import` command, see [Import data from a file with `-import`](/influxdb/v1/tools/influx-cli/use-influx/#import-data-from-a-file).
For details on using the `influx -import` command, see [Import data from a file](/influxdb/v1/tools/influx-cli/use-influx-cli/#import-data-from-a-file).
### Example: export and import for disaster recovery
### Example: export and import for disaster recovery
For an example of using the exporting and importing data approach for disaster recovery, see the presentation from Influxdays 2019 on ["Architecting for Disaster Recovery."](https://www.youtube.com/watch?v=LyQDhSdnm4A). In this presentation, Capital One discusses the following:

View File

@ -14,4 +14,4 @@ menu:
To migrate InfluxDB {{< current-version >}} to InfluxDB Enterprise, follow the
instructions provided in
[Migrate InfluxDB OSS instances to InfluxDB Enterprise clusters](/enterprise_influxdb/v1/guides/migration/)
In the InfluxDB Enterprise documentation.
in the InfluxDB Enterprise documentation.

View File

@ -287,11 +287,11 @@ $ influx -format=json -pretty
### Import data from a file
The import file has two sections:
An import file has two sections:
* **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/influxdb/v1/query_language/manage-database/) for creating the relevant [database](/influxdb/v1/concepts/glossary/) and managing the [retention policy](/influxdb/v1/concepts/glossary/#retention-policy-rp).
- _Optional_: **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/influxdb/v1/query_language/manage-database/) for creating the relevant [database](/influxdb/v1/concepts/glossary/) and managing the [retention policy](/influxdb/v1/concepts/glossary/#retention-policy-rp).
If your database and retention policy already exist, your file can skip this section.
* **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/influxdb/v1/concepts/glossary/#influxdb-line-protocol).
- **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/influxdb/v1/concepts/glossary/#influxdb-line-protocol).
Example: