Chirpstack Upgrade

Hi

I have been running chirpstack in k8s with the following version of the image. It has been very stable components and never needed to upgrade.

But it looks like it is a good time to upgrade to chirpstack 4 but what will be the safest and closest version to upgrade before upgrading to chirpstack 4 images? -

My current versions are

chirpstack/chirpstack-application-server:3.17.9
chirpstack/chirpstack-network-server:3.13
chirpstack/chirpstack-gateway-bridge:3.11
eclipse-mosquitto:2.0.11
redis:6.2.3

I recommend reading the upgrade docs thoroughly:

https://www.chirpstack.io/docs/

First, it’s “recommended to make a database backup”, which is left as an exercise for reader (it’s where I’m stuck, with postgres - I don’t have Docker, whatever that is, which most instructions assume).

Then, you will need to update your 3.xx versions to latest release. Except Downloads only has 4.xx.

Only then should you go to V3 to V4 migration documentation

There are many ways to backup a PSQL database, using pg_dumpall should be as easy as:

# Create a file for psql backup dump
$ touch postgresbackup

# dump all sql backup commands from container and pipe into backup file
$ pg_dumpall -c --no-password -h localhost -U postgres > postgresbackup

# Restore database from backup file
$ psql -h localhost -U postgres < postgresbackup

[if you assume I don’t know what I’m doing, you will be just very slightly wrong]

When I run pg_dumpall line you recommend, it insists on a password:

ds-admin@DSE-MFG95:~$ pg_dumpall -c --no-password -h localhost -U postgres > postgresbackup
pg_dumpall: error: connection to server at “localhost” (127.0.0.1), port 5432 failed: fe_sendauth: no password supplied

I should explain that, long time ago, I created CS V3 that I’m running using instructions from www.mobilefish.com; specifically this section:
image

Dumb Q: given those instructions, I presume password for pg_dumpall should be ‘dbpassword’, but I get same error: (it prompts for password & I type dbpassword)

ds-admin@DSE-MFG95:~$ pg_dumpall -c -h localhost -U postgres > postgresbackup
Password:
pg_dumpall: error: connection to server at “localhost” (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user “postgres”
connection to server at “localhost” (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user “postgres”

Just to see what would happen, I followed first line of #5, and output gave me a ray of hope:

ds-admin@DSE-MFG95:~$ sudo -u postgres psql
psql (17.1 (Ubuntu 17.1-1.pgdg20.04+1), server 12.21 (Ubuntu 12.21-1.pgdg20.04+1))
Type “help” for help.
postgres-# \c chirpstack_ns
psql (17.1 (Ubuntu 17.1-1.pgdg20.04+1), server 12.21 (Ubuntu 12.21-1.pgdg20.04+1))
You are now connected to database “chirpstack_ns” as user “postgres”.
chirpstack_ns-# \dt
List of relations
Schema | Name | Type | Owner
--------±--------------------------------±------±--------------
public | code_migration | table | chirpstack_ns
public | device | table | chirpstack_ns
public | device_activation | table | chirpstack_ns
public | device_multicast_group| table | chirpstack_ns
public | device_profile | table | chirpstack_ns
public | device_queue | table | chirpstack_ns
public | gateway | table | chirpstack_ns
public | gateway_board | table | chirpstack_ns
public | gateway_profile | table | chirpstack_ns
public | gateway_profile_extra_channel | table | chirpstack_ns
public | multicast_group | table | chirpstack_ns
public | multicast_queue | table | chirpstack_ns
public | routing_profile | table | chirpstack_ns
public | schema_migrations | table | chirpstack_ns
public | service_profile | table | chirpstack_ns
(15 rows)

On the off-chance that I set a different password, I checked /etc/chirpstack-network-server/chirpstack-network-server.toml and it doesn’t look like I deviated from setup instructions:

#fmg
#dsn=“postgres://localhost/chirpstack_ns_ns?sslmode=disable”
dsn=“postgres://chirpstack_ns:dbpassword@localhost/chirpstack_ns?sslmode=disable”

Is there some way for me to run a pg_dumpall from inside “sudo -u postgres psql”, which works?

I have no idea what to do next.

I believe the dbpassword is the password for the user chirpstack_ns not postgres, the pg_dumpall might also work from the chirpstack_ns server so you could give that a try.

Other options:

Have you tried just:
sudo -u postgres pg_dumpall -c -h localhost > postgresbackup

If that doesn’t work you could try changing the postgres user password:

sudo -u postgres psql

ALTER USER postgres WITH PASSWORD 'new_password';

ds-admin@DSE-MFG95:~$ sudo -u postgres pg_dumpall -c -h localhost > postgresbackup
Password:
pg_dumpall: error: connection to server at “localhost” (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user “postgres”
connection to server at “localhost” (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user “postgres”

I am planning a different path:

  1. I got a new virtual server and am installing a fresh CS V4. To this, I will add all sensors that I couldn’t configure under V3 (due to incompatible CODECs).
  2. Originally, I installed “too many” gateways (5, since disabled 2, in facility <1 sq km!), so I will reprogram one of them to send data to the new CS V4.
  3. I will set SCADA to subscribe to sensors on CS V3 and CS V4.
  4. I will move over critical existing sensors to V4.
  5. Later, I will change batteries in all sensors currently configured in CS V3, disable V3, and join sensors anew to V4.

Will that work?

P.S. I am leery of changing passwords in postgres, in case this breaks V3 - I can’t afford to lose telemetry from existing sensors (in #4) as some have a vote in important alarms.

Yes that will work, as long as power cycling the devices triggers a re-join.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.