@[email protected] to [email protected]English • 1 year agoHow to backup the DB before upgrading Lemmy?message-square3fedilinkarrow-up110arrow-down12file-text
arrow-up18arrow-down1message-squareHow to backup the DB before upgrading Lemmy?@[email protected] to [email protected]English • 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-squareRuudAlinkEnglish2•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