meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sw:chirpstack:migrate_to_v4 [2024/09/09 19:22] – created niziak | sw:chirpstack:migrate_to_v4 [2024/09/09 19:42] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Docker migrate 3 to 4 ====== | ====== Docker migrate 3 to 4 ====== | ||
| + | |||
| + | In Chirpstack 4 old NS and AS are replaced by one Chirpstack V4. | ||
| + | |||
| + | Idea is to add to '' | ||
| + | Additionally Debian based container is created only to run converter script. Converter script doesn' | ||
| + | |||
| + | See [[https:// | ||
| + | |||
| + | Steps: | ||
| + | * copy '' | ||
| + | * copy postgresql configuration to new directory '' | ||
| + | * add 3 new services do old docker-compose (based on docker-compose from CSv4). Old postgres and redis are left intact. | ||
| + | * chirpstack - remember to pin it ot 4.8.1 which is supported by converter | ||
| + | * postgres_cs4 | ||
| + | * redis_cs4 | ||
| + | * Adapt host names and ports in environment variables. | ||
| + | * review and fill api secret in '' | ||
| + | * add '' | ||
| + | * disable other regions in '' | ||
| + | * temporary replace env variables with host names in '' | ||
| + | * build and place '' | ||
| + | * backup old redis and postgres | ||
| + | |||
| + | In result: | ||
| + | <file yaml docker-compose.yml> | ||
| + | cat docker-compose.yml | ||
| + | version: " | ||
| + | |||
| + | services: | ||
| + | chirpstack: | ||
| + | image: chirpstack/ | ||
| + | command: -c / | ||
| + | restart: unless-stopped | ||
| + | volumes: | ||
| + | - ./ | ||
| + | - ./ | ||
| + | depends_on: | ||
| + | - postgres_cs4 | ||
| + | - mosquitto | ||
| + | - redis_cs4 | ||
| + | environment: | ||
| + | - MQTT_BROKER_HOST=mosquitto | ||
| + | - REDIS_HOST=redis_cs4: | ||
| + | - POSTGRESQL_HOST=postgres_cs4: | ||
| + | ports: | ||
| + | - 18080:8080 | ||
| + | |||
| + | debian: | ||
| + | image: debian: | ||
| + | command: sleep 60000 | ||
| + | volumes: | ||
| + | - ./ | ||
| + | - ./ | ||
| + | - ./ | ||
| + | - ./ | ||
| + | |||
| + | postgres_cs4: | ||
| + | image: postgres: | ||
| + | restart: unless-stopped | ||
| + | volumes: | ||
| + | - ./ | ||
| + | - postgresqldata_cs4:/ | ||
| + | environment: | ||
| + | - POSTGRES_PASSWORD=root | ||
| + | - PGPORT=5433 | ||
| + | |||
| + | redis_cs4: | ||
| + | image: redis: | ||
| + | restart: unless-stopped | ||
| + | command: redis-server --save 300 1 --save 60 100 --appendonly no --port 6380 | ||
| + | volumes: | ||
| + | - redisdata_cs4:/ | ||
| + | |||
| + | |||
| + | # chirpstack-network-server: | ||
| + | # image: chirpstack/ | ||
| + | # volumes: | ||
| + | # - ./ | ||
| + | # restart: always | ||
| + | # depends_on: | ||
| + | # - postgresql | ||
| + | # - mosquitto | ||
| + | |||
| + | # chirpstack-application-server: | ||
| + | # image: chirpstack/ | ||
| + | # ports: | ||
| + | # - 8085:8080 | ||
| + | # volumes: | ||
| + | # - ./ | ||
| + | # restart: always | ||
| + | # depends_on: | ||
| + | # - chirpstack-network-server | ||
| + | |||
| + | |||
| + | # chirpstack-gateway-bridge: | ||
| + | # image: chirpstack/ | ||
| + | # ports: | ||
| + | # - 1700: | ||
| + | # volumes: | ||
| + | # - ./ | ||
| + | # restart: always | ||
| + | # depends_on: | ||
| + | # - mosquitto | ||
| + | |||
| + | # chirpstack-geolocation-server: | ||
| + | # image: chirpstack/ | ||
| + | # volumes: | ||
| + | # - ./ | ||
| + | # restart: always | ||
| + | |||
| + | postgresql: | ||
| + | image: postgres: | ||
| + | environment: | ||
| + | - POSTGRES_PASSWORD=root | ||
| + | volumes: | ||
| + | - ./ | ||
| + | - postgresqldata:/ | ||
| + | restart: always | ||
| + | |||
| + | redis: | ||
| + | image: redis: | ||
| + | volumes: | ||
| + | - redisdata:/ | ||
| + | restart: always | ||
| + | |||
| + | mosquitto: | ||
| + | image: eclipse-mosquitto: | ||
| + | ports: | ||
| + | - 1883:1883 | ||
| + | volumes: | ||
| + | - ./ | ||
| + | restart: always | ||
| + | |||
| + | volumes: | ||
| + | postgresqldata: | ||
| + | postgresqldata_cs4: | ||
| + | redisdata: | ||
| + | redisdata_cs4: | ||
| + | </ | ||
| + | |||
| + | Start all containers: '' | ||
| + | |||
| + | Chirpstack V4 is needed to seed new database. Without it converter is not working. | ||
| + | |||
| + | Then login into Debian helper container '' | ||
| <code bash> | <code bash> | ||
| + | cd /opt | ||
| ./ | ./ | ||
| --as-config-file / | --as-config-file / | ||
| --ns-config-file / | --ns-config-file / | ||
| - | --cs-config-file / | + | --cs-config-file / |
| + | --drop-tenants-and-users | ||
| </ | </ | ||