this post was submitted on 13 Jun 2023
2 points (100.0% liked)

Lemmy Support

4662 readers
22 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I'm trying to migrate lemmyfly.org to a server with more capacity at a different provider. From the current running OK server I've downloaded the volumes folder using rsync. The new server is installed using ansible with success, all containers are up and running.

Then I stop the containers, rm volumes, copy the volumes from the backup location to the new server.

Now when trying to start the containers, the pictrs and postgres containers have errors. I noticed the volumes folder now have different owner (staff in stead of root). So I manually changed ownership of those folders to root. Now those containers can start ok. But now the lemmy container can't authenticate with postgres, although the password is all the same in the config files.

There must be an easier way to restore a backup. What am I missing ?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago

seems like I was nearly there :) yes you copy the volumes folder, and change ownership to those folders. But then the db has the password from your previous installation stored, so you need to change that. Copy the password from your docker-compose.yml file, and add it to the database like this: docker exec -i FOLDERNAME_postgres_1 psql -U lemmy -c "alter user lemmy with password 'bleh'"

(from https://join-lemmy.org/docs/en/administration/backup_and_restore.html)