this post was submitted on 23 Jun 2023
5 points (85.7% liked)

Lemmy

13486 readers
79 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 5 years ago
MODERATORS
 

Hi, Do you have any suggestions on how to backup the database or any other suggestions before upgrading Lemmy?

you are viewing a single comment's thread
view the rest of the comments
[–] ruud@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

Either do a pg_dump or stop the database and make a full copy.

The pg_dump won't require downtime but will take longer to restore.

I use this command for the pg_dump

docker exec lemmy_postgres_1 pg_dump -Fc -U lemmy lemmy > /opt/lemmy/backup/lemmy_db_`date +%Y%m%d`.dump