dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 weeks ago | |
|---|---|---|
| .. | ||
| docker | 2 months ago | |
| README.md | 2 weeks ago | |
| pom.xml | 2 months ago | |
README.md
Can be run with
docker run --env-file migrator.env thingsboard/tb-migrator:latest
Example of migrator.env for tenant export:
MIGRATOR_MODE=TENANT_DATA_EXPORT
WORKING_DIRECTORY=/tmp/tb-migration/data # will be created automatically
POSTGRES_EXPORT_ENABLED=true # to export all tenant's entities
EXPORTED_TENANT_ID=<TENANT_ID> # id of the tenant to export
DATABASE_URL=jdbc:postgresql://<POSTGRES_HOST>:5432/thingsboard
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
SKIPPED_TABLES=RULE_NODE_DEBUG_EVENT,STATS_EVENT,LC_EVENT # Postgres tables to skip export for
CASSANDRA_EXPORT_ENABLED=true # to export all tenant's timeseries history
CASSANDRA_URL=127.0.0.1:9042 # contact points
CASSANDRA_LOCAL_DATACENTER=datacenter1
PARALLELISM_LEVEL=4
For a PostgreSQL-only (or TimescaleDB) source, set CASSANDRA_EXPORT_ENABLED=false and POSTGRES_TS_EXPORT_ENABLED=true to export timeseries history from PostgreSQL ts_kv (see migrator/src/main/resources/README.md).
Timeseries history is split into files of about TS_KV_EXPORT_MAX_FILE_SIZE_MB (default 256). Older migrator versions can't import them; 0 writes a single ts_kv.gz they can read.
Example of migrator.env for tenant import:
MIGRATOR_MODE=TENANT_DATA_IMPORT
WORKING_DIRECTORY=/tmp/tb-migration/data # directory with all the previously exported tenant's data
POSTGRES_IMPORT_ENABLED=true # to import all tenant's entities
DATABASE_URL=jdbc:postgresql://<POSTGRES_HOST>:5432/thingsboard
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
SKIPPED_TABLES=RULE_NODE_DEBUG_EVENT,STATS_EVENT,LC_EVENT # Postgres tables to skip import for
CASSANDRA_IMPORT_ENABLED=true # to import all tenant's timeseries history
CASSANDRA_URL=127.0.0.1:9042 # contact points
CASSANDRA_LOCAL_DATACENTER=datacenter1
PARALLELISM_LEVEL=4
Before importing, create a temporary tenant and then delete it, so that system roles are created.