gabriele97@lemmy.g97.top to Lemmy@lemmy.mlEnglish · 1 year agoHow to backup the DB before upgrading Lemmy?message-squaremessage-square3fedilinkarrow-up19arrow-down12file-text
arrow-up17arrow-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-squarefuser@quex.cclinkfedilinkEnglisharrow-up1·1 year agoyou can run something like this on the host - make sure you use the correct container name #!/bin/bash # check the container name with docker ps first container_name="instance_name_postgres_1" echo "dumping pgsql" # Backup command docker exec -t "${container_name}" pg_dumpall -c -U lemmy > lemmy_dump.sql suggest you not leave unencrypted backup on the host system but copy it somewhere else, preferably after encrypting it with gpg.
you can run something like this on the host - make sure you use the correct container name
#!/bin/bash # check the container name with docker ps first container_name="instance_name_postgres_1" echo "dumping pgsql" # Backup command docker exec -t "${container_name}" pg_dumpall -c -U lemmy > lemmy_dump.sql
suggest you not leave unencrypted backup on the host system but copy it somewhere else, preferably after encrypting it with gpg.