https://prefect.io logo
#prefect-server
Title
# prefect-server
g

Gagan Singh Saluja

12/03/2021, 7:23 AM
Hi , if the server goes down for some reason, how to ensure that the data is persistent? Because every time I close and start the server I loose the track of the previous runs and metrics in UI
a

Amanda Wee

12/03/2021, 7:39 AM
You can have a separate persistent postgresql database that your prefect server connects to.
upvote 1
g

Gagan Singh Saluja

12/03/2021, 7:40 AM
Could you please share a link for the document which I can follow, that would be of great help
g

Gagan Singh Saluja

12/03/2021, 7:43 AM
Thanks
@Amanda Wee hi tried this, mounted the external volume in ec2 and started the server as mention in docs , but still data is not persistent , data is lost at server restart
prefect server start —expose —volume-path /prefect_volume/ This is the command I used
@Anna Geller
a

Anna Geller

12/08/2021, 3:49 PM
@Gagan Singh Saluja you can try:
Copy code
prefect server start --use-volume --expose
this will use the default volume in
~/.prefect/pg_data
what Amanda was suggesting is a more robust solution: using an external Postgres database, e.g. you could deploy one on AWS or GCP
g

Gagan Singh Saluja

12/08/2021, 3:53 PM
Thanks, Is there any way to use a volume attached to ec2 @Anna Geller ?
a

Anna Geller

12/08/2021, 3:55 PM
you should not confuse a Docker volume with an EBS volume on AWS 🙂 we’re talking about a Docker volume for a Postgres database data here
or: an external database that wouldn’t need any Docker volume at all
g

Gagan Singh Saluja

12/08/2021, 3:57 PM
Oh , okay thanks a lot
👍 1