Hi I have noticed that after restarting prefect se...
# prefect-community
b
Hi I have noticed that after restarting prefect server I have lost history and flows and I have to register all my flows once again. Is it possible preserve history and flows after stoping server?
n
Hi @Bartek! Because all of the Prefect Server infrastructure is run inside Docker containers, each time you're restarting Prefect Server, you're probably also tearing down and rebuilding the PostgreSQL container. As a result, the data inside the previous container is lost. We're looking to expand some of the options for deploying Prefect Server, including better exposing the ability to create longstanding DB connections but in the meantime you'll need to manually adjust connection settings to connect to an instance of PostgreSQL that won't be torn down with the server.
b
hi @nicholas I have manage to solve it just by adding volume to docker-compose file
Copy code
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
   - /path/to/db:/var/lib/postgresql/data
maybe it could be good to add this to config.toml?
👍 1
n
That's a good callout, would you be able to open a PR for that?
If not, I can open a ticket to make that happen 🙂
b
ok, I will do it 👍