@[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-square@[email protected]linkfedilinkEnglish1•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.