mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
Remove links to helper scripts (#7372)
* Remove links to helper scripts * Delete db_migrator.markdown * Delete influxdb_migrator.markdown * Delete influxdb_import.markdown * Update docs_navigation.html
This commit is contained in:
parent
897935a037
commit
d3935c1390
@ -137,11 +137,6 @@ component_config_glob:
|
||||
required: false
|
||||
{% endconfiguration %}
|
||||
|
||||
## {% linkable_title Helper scripts %}
|
||||
|
||||
- [Helper script `influxdb_import`](/docs/tools/influxdb_import/)
|
||||
- [Helper script `db_migrator`](/docs/tools/db_migrator/) (only used for [Home Assistant 0.36](/blog/2017/01/14/iss-usps-images-packages/#influxdb-export))
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
### {% linkable_title Full configuration %}
|
||||
|
@ -1,71 +0,0 @@
|
||||
---
|
||||
layout: page
|
||||
title: "db_migrator"
|
||||
description: "Script to migrate data in an InfluxDB database"
|
||||
release_date: 2017-02-23 11:00:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
<p class='note warning'>
|
||||
This script was only use for 0.36 release cycle!
|
||||
</p>
|
||||
|
||||
Starting with 0.36 the [InfluxDB](omponents/influxdb/) component has a new schema to store values in the InfluxDB databases.
|
||||
|
||||
- There will no longer be any tags/fields named `time`.
|
||||
- All numeric fields (int/float/bool) will be stored as float inside InfluxDB database.
|
||||
- All string fields corresponding to state attributes will be renamed as `FIELDNAME_str`, where `FIELDNAME` is the state attribute, to avoid type conflicts.
|
||||
- All string fields corresponding to a state will be renamed as `state` (former value).
|
||||
- Fields named `value` will always be stored as float.
|
||||
- Fields named `state` will always be stored as string.
|
||||
|
||||
## {% linkable_title Migration script %}
|
||||
|
||||
If you need to migrate your database, you may require to run the `influxdb_migrator` script. Run the script after upgrade to 0.36 but before the first regular start of `hass` version 0.36.
|
||||
|
||||
These are the steps the script will perform:
|
||||
|
||||
1. Create a new database (called `DBNAME__old`) to store old data.
|
||||
2. Copy data from `DBNAME` database to `DBNAME__old` database.
|
||||
3. Empty `DBNAME` database (using `drop` then `create`). `DBNAME` database is now considered as the new database.
|
||||
4. For each measurement of `DBNAME__old` database:
|
||||
1. Read all points from the current measurement (in groups of 1000 points by default) and convert them.
|
||||
2. Send group of points to `DBNAME` database.
|
||||
5. Delete the `DBNAME__old` database if needed.
|
||||
|
||||
Example to run the script:
|
||||
|
||||
```bash
|
||||
$ hass --script influxdb_migrator \
|
||||
-H IP_INFLUXDB_HOST -u INFLUXDB_USERNAME -p INFLUXDB_PASSWORD \
|
||||
-d INFLUXDB_DB_NAME
|
||||
```
|
||||
Script arguments:
|
||||
|
||||
```
|
||||
required arguments:
|
||||
-d dbname, --dbname dbname InfluxDB database name
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-H host, --host host InfluxDB host address
|
||||
-P port, --port port InfluxDB host port
|
||||
-u username, --username username
|
||||
InfluxDB username
|
||||
-p password, --password password
|
||||
InfluxDB password
|
||||
-s step, --step step How many points to migrate at the same time
|
||||
-o override_measurement, --override-measurement override_measurement
|
||||
Store all your points in the same measurement
|
||||
-D, --delete Delete old database
|
||||
```
|
||||
|
||||
- If you run the script with only the `-h` option, you will get a help printout with a short explanation of the different options.
|
||||
- The host option defaults to `'127.0.0.1'`.
|
||||
- The port option defaults to `8086`.
|
||||
- You should be able to omit username and password if InfluxDB authentication is disabled, which it is by default.
|
||||
- The step option defaults to `1000`.
|
||||
|
@ -1,63 +0,0 @@
|
||||
---
|
||||
layout: page
|
||||
title: "influxdb_import"
|
||||
description: "Script to import data into an InfluxDB database"
|
||||
release_date: 2017-02-23 11:00:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
If you want to import all the recorded data from your recorder database you can use the data import script. It will read all your state_change events from the database and add them as data-points to the InfluxDB. You can specify the source database either by pointing the `--config` option to the config directory which includes the default SQLite database or by giving a sqlalchemy connection URI with `--uri`.
|
||||
|
||||
The writing to InfluxDB is done in batches that can be changed with `--step`.
|
||||
|
||||
You can control, which data is imported by using the command line options `--exclude_entities` and `--exclude_domains`. Both get a comma separated list of either entity-ids or domain names that are excluded from the import.
|
||||
|
||||
To test what gets imported you can use the `--simulate` option, which disables the actual write to the InfluxDB instance. This only writes the statistics how much points would be imported from which entity.
|
||||
|
||||
Example to run the script:
|
||||
|
||||
```bash
|
||||
$ hass --script influxdb_import --config CONFIG_DIR \
|
||||
-H IP_INFLUXDB_HOST -u INFLUXDB_USERNAME -p INFLUXDB_PASSWORD \
|
||||
--dbname INFLUXDB_DB_NAME --exclude_domains automation,configurator
|
||||
```
|
||||
Script arguments:
|
||||
|
||||
```
|
||||
required arguments:
|
||||
-d dbname, --dbname dbname
|
||||
InfluxDB database name
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-c path_to_config_dir, --config path_to_config_dir
|
||||
Directory that contains the Home Assistant
|
||||
configuration
|
||||
--uri URI Connect to URI and import (if other than default
|
||||
sqlite) eg: mysql://localhost/homeassistant
|
||||
|
||||
-H host, --host host InfluxDB host address
|
||||
-P port, --port port InfluxDB host port
|
||||
-u username, --username username
|
||||
InfluxDB username
|
||||
-p password, --password password
|
||||
InfluxDB password
|
||||
-s step, --step step How many points to import at the same time
|
||||
-t tags, --tags tags Comma separated list of tags (key:value) for all
|
||||
points
|
||||
-D default_measurement, --default-measurement default_measurement
|
||||
Store all your points in the same measurement
|
||||
-o override_measurement, --override-measurement override_measurement
|
||||
Store all your points in the same measurement
|
||||
-e exclude_entities, --exclude_entities exclude_entities
|
||||
Comma separated list of excluded entities
|
||||
-E exclude_domains, --exclude_domains exclude_domains
|
||||
Comma separated list of excluded domains
|
||||
-S, --simulate Do not write points but simulate preprocessing
|
||||
and print statistics
|
||||
```
|
||||
|
||||
|
@ -1,39 +0,0 @@
|
||||
---
|
||||
layout: page
|
||||
title: "influxdb_migrator"
|
||||
description: "Script to convert an old-structure Influx database to a new one."
|
||||
release_date: 2017-02-23 11:00:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Script to convert an old-structure Influx database to a new one.
|
||||
|
||||
Example to run the script:
|
||||
|
||||
```bash
|
||||
$ hass --script influxdb_migrator -H IP_INFLUXDB_HOST \
|
||||
-u INFLUXDB_USERNAME -p INFLUXDB_PASSWORD \
|
||||
--dbname INFLUXDB_DB_NAME
|
||||
```
|
||||
Script arguments:
|
||||
|
||||
```
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-d dbname, --dbname dbname
|
||||
InfluxDB database name
|
||||
-H host, --host host InfluxDB host address
|
||||
-P port, --port port InfluxDB host port
|
||||
-u username, --username username
|
||||
InfluxDB username
|
||||
-p password, --password password
|
||||
InfluxDB password
|
||||
-s step, --step step How many points to migrate at the same time
|
||||
-o override_measurement, --override-measurement override_measurement
|
||||
Store all your points in the same measurement
|
||||
-D, --delete Delete old database
|
||||
```
|
||||
|
@ -96,10 +96,7 @@
|
||||
<li>{% active_link /docs/tools/benchmark/ benchmark %}</li>
|
||||
<li>{% active_link /docs/tools/check_config/ check_config %}</li>
|
||||
<li>{% active_link /docs/tools/credstash/ credstash %}</li>
|
||||
<li>{% active_link /docs/tools/db_migrator/ db_migrator %}</li>
|
||||
<li>{% active_link /docs/tools/ensure_config/ ensure_config %}</li>
|
||||
<li>{% active_link /docs/tools/influxdb_import/ influxdb_import %}</li>
|
||||
<li>{% active_link /docs/tools/influxdb_migrator/ influxdb_migrator %}</li>
|
||||
<li>{% active_link /docs/tools/keyring/ keyring %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user