Docker Backup, activation data gone

Hello, i am testing the backups of my deployment of Chirpstack with Docker, what i do is copy the data from Postgres and Redis volumes, (stopping the container before the copy).

As you can see on the screenshots the activation data is gone when i recover the backup, the first one is the working server, and the second one is the restored instance;

Same Device EUI, but the activation information is gone.

Is there something that am i doing wrong? or missing something?

How can i do a backup wich includes the activation data?

Thanks!

Are the servers the same version? The session keys were moved in 4.7 so if the versions were before and after it that would happen.

If thats not the issue what is your backup process, do you pg_dumpall the psql database and copy the redis dump.db?

which api rest are you using?

No, they are on different versions but i dont know how to check the version number, on docker it only says chirpstack/chirpstack:4, both are in version 4 but i dont know how to get more info.

How can i get the version number?

Yes, i stop the containers, copy redis database from the volume and pg_dump the postgres database.

Thanks!

The captures are from Swagger UI

I believe chirpstack:4 will only bring you to 4.6 (before the session key move). But if you enter your container with sudo docker exec -it <container-name> sh you can run chirpstack --version to tell the version.

could you elaborate on this session key move? where did move from and where did it go to?

The sessions key move from one server to a new one, and it will stay on the old one despite doing a backup of everything

sorry @sermore I don’t follow

The device activation data - session keys, fcnt, etc… were moved from redis to postgres in 4.7.

2 Likes

I didn’t know that. But if the sessions are stored in PostgreSQL, why don’t they persist in the new ChirpStack instance?

I copied the Redis and PostgreSQL volumes from Docker on the old server to Docker on the new one. So if the sessions are in PostgreSQL, they should be present on the new server — but they aren’t.

I’m going to update to the latest ChirpStack version and try again.

I’m starting to think it might have something to do with the fact that it’s running in Docker.

Thank you so much for your time.

My point was if your old server is on Chirpstack 4.6 or less (where device sessions are in redis), and your new server is version 4.7 or higher (where device sessions are in postgres).

Doing the backup and restore from your old server to your new server would leave the device sessions in redis, but your new server would be looking for the sessions in postgres, thus you would “lose” your device sessions in chirpstack. If this was your issue, you would need to do then is run the migration command chirpstack -c /etc/chirpstack migrate-device-sessions-to-postgres to move the device sessions from redis to postgres.

Essentially what you’ve done is update your server without running the necessary migration command for that update.

Thank you Liam , this was super helpful, so as of now if Redis state is lost, it is not a big deal right? also where are the LoRaWAN frames state kept, this is not in redis or postgres… as I have restored both and nothing shows up here