[GH-ISSUE #4728] NETBIRD_STORE_ENGINE_POSTGRES_DSN is not set #9755

Open
opened 2026-08-05 01:23:22 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @pavelsidla on GitHub (Oct 30, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4728

Describe the problem

Hello i am trying to migrate my management from local sql database to AWS postgresql
I did everything base on this guide
https://docs.netbird.io/selfhosted/postgres-store#migrating-from-sq-lite-store-to-postgres-store
When i set this to docker compose file
environment:

  • NETBIRD_STORE_ENGINE_POSTGRES_DSN=${NETBIRD_STORE_ENGINE_POSTGRES_DSN}
    env_file:
  • .env

And added this to .env NETBIRD_STORE_ENGINE_POSTGRES_DSN="host=<PG_HOST> user=<PG_USER> password=<PG_PASSWORD> dbname=<PG_DB_NAME> port=<PG_PORT>"

I am still getting error NETBIRD_STORE_ENGINE_POSTGRES_DSN is not set when i restart management container

I am using latest netbird version, i have crated database for netbird i have sucessfully migrated everything to it based on guide but i am still not able to make this work.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Are you using NetBird Cloud?

Please specify whether you use NetBird Cloud or self-host NetBird's control plane.

NetBird version

netbird version

Is any other VPN software installed?

If yes, which one?

Debug output

To help us resolve the problem, please attach the following anonymized status output

netbird status -dA

Create and upload a debug bundle, and share the returned file key:

netbird debug for 1m -AS -U

Uploaded files are automatically deleted after 30 days.

Alternatively, create the file only and attach it here manually:

netbird debug for 1m -AS

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @pavelsidla on GitHub (Oct 30, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4728 **Describe the problem** Hello i am trying to migrate my management from local sql database to AWS postgresql I did everything base on this guide https://docs.netbird.io/selfhosted/postgres-store#migrating-from-sq-lite-store-to-postgres-store When i set this to docker compose file environment: - NETBIRD_STORE_ENGINE_POSTGRES_DSN=${NETBIRD_STORE_ENGINE_POSTGRES_DSN} env_file: - .env And added this to .env NETBIRD_STORE_ENGINE_POSTGRES_DSN="host=<PG_HOST> user=<PG_USER> password=<PG_PASSWORD> dbname=<PG_DB_NAME> port=<PG_PORT>" I am still getting error NETBIRD_STORE_ENGINE_POSTGRES_DSN is not set when i restart management container I am using latest netbird version, i have crated database for netbird i have sucessfully migrated everything to it based on guide but i am still not able to make this work. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Are you using NetBird Cloud?** Please specify whether you use NetBird Cloud or self-host NetBird's control plane. **NetBird version** `netbird version` **Is any other VPN software installed?** If yes, which one? **Debug output** To help us resolve the problem, please attach the following anonymized status output netbird status -dA Create and upload a debug bundle, and share the returned file key: netbird debug for 1m -AS -U *Uploaded files are automatically deleted after 30 days.* Alternatively, create the file only and attach it here manually: netbird debug for 1m -AS **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [ ] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [ ] Checked for newer NetBird versions - [ ] Searched for similar issues on GitHub (including closed ones) - [ ] Restarted the NetBird client - [ ] Disabled other VPN software - [ ] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 01:23:22 -04:00
Author
Owner

@hexclann commented on GitHub (Dec 23, 2025):

@pavelsidla I was also facing the same issue because of incorrect documentation. I was able to fix the issue by:

Before running these command make sure to backup and migrate using the commands mentioned in the docs.

  1. Create db.env file which should contain
NETBIRD_STORE_CONFIG_ENGINE=postgres
NB_ACTIVITY_EVENT_STORE_ENGINE=postgres
NETBIRD_STORE_ENGINE_POSTGRES_DSN=host=localhost user=test password=test dbname=postgres port=5432
NB_ACTIVITY_EVENT_POSTGRES_DSN=host=localhost user=test password=test dbname=postgres port=5432

Make sure to remove the quotes from the variable.

  1. Just mention the env file in the docker-compose.yml
    env_file:
      - db.env

Do not define any variables here

  1. Re-launch the container:
export $(cat db.env | xargs)
docker compose down
docker compose up -d

Check the container logs, you should be now using the postgres db

<!-- gh-comment-id:3685805260 --> @hexclann commented on GitHub (Dec 23, 2025): @pavelsidla I was also facing the same issue because of incorrect documentation. I was able to fix the issue by: Before running these command make sure to backup and migrate using the commands mentioned in the docs. 1. Create db.env file which should contain ``` NETBIRD_STORE_CONFIG_ENGINE=postgres NB_ACTIVITY_EVENT_STORE_ENGINE=postgres NETBIRD_STORE_ENGINE_POSTGRES_DSN=host=localhost user=test password=test dbname=postgres port=5432 NB_ACTIVITY_EVENT_POSTGRES_DSN=host=localhost user=test password=test dbname=postgres port=5432 ``` Make sure to remove the quotes from the variable. 2. Just mention the env file in the docker-compose.yml ``` env_file: - db.env ``` Do not define any variables here 3. Re-launch the container: ``` export $(cat db.env | xargs) docker compose down docker compose up -d ``` Check the container logs, you should be now using the postgres db
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9755