gabriele97@lemmy.g97.top to Lemmy@lemmy.mlEnglish · 1 year agoHow to backup the DB before upgrading Lemmy?message-squaremessage-square3fedilinkarrow-up17arrow-down11file-text
arrow-up16arrow-down1message-squareHow to backup the DB before upgrading Lemmy?gabriele97@lemmy.g97.top to Lemmy@lemmy.mlEnglish · 1 year agomessage-square3fedilinkfile-text
Hi, Do you have any suggestions on how to backup the database or any other suggestions before upgrading Lemmy?
minus-squareRuud@lemmy.worldlinkfedilinkEnglisharrow-up1·edit-21 year agoEither 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
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