this post was submitted on 23 Jun 2023
6 points (80.0% liked)

Lemmy

12575 readers
1 users here now

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

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

founded 4 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 1 year ago* (last edited 1 year 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