I have taken backup dump data from locally installed Postgres and restored it to chirpstack Postgres docker container. But after this, I have got a problem with authentication. I found the issue where it happened. The issue is in volume. If I do docker-compose down and delete the chirpstack-docker_postgresqldata volume and do docker-compose up then it works fine. How can I manage volumes while restoring the data?
Used steps to take backup :
sudo -i -u postgres
pg_dumpall --username=postgres --file=database-dump.sql
Used steps to restore the data :
docker cp /path/to/your-database-dump.sql chirpstack_postgres:/database-dump.sql
docker exec -it chirpstack_postgres /bin/bash
su - postgres
psql -U postgres -f /database-dump.sql
Error Log :
chirpstack-application-server_1 | time="2023-07-14T06:20:27.154562656Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="pq: password authentication failed for user \"chirpstack_as\""
postgresql_1 | FATAL: password authentication failed for user "chirpstack_ns"
postgresql_1 | DETAIL: Password does not match for user "chirpstack_ns".
postgresql_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
chirpstack-network-server_1 | time="2023-07-14T06:20:28.91792988Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="pq: password authentication failed for user \"chirpstack_ns\""