Thread
#prefect-community
    b

    Bartek

    2 years ago
    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?
    nicholas

    nicholas

    2 years ago
    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

    Bartek

    2 years ago
    hi @nicholas I have manage to solve it just by adding volume to docker-compose file
    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?
    nicholas

    nicholas

    2 years ago
    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

    Bartek

    2 years ago
    ok, I will do it 👍