Hello again, I hope it’s okay that I make several posts in a rather short time, I’m stumped.
I run a series of containers on old computer A for the recipe manager Tandoor Recipes.
I want to move it to another computer B so I initially thought I would: -copy the env and docker-compose -dump the source database
Move everything to the new computer, compose everything and fill the database from the dump.
I got 500 server errors so I went on Discord and asked what was the proper way of doing this. I’ve been told in theory I could shut everything down, pack my Tandoor folder in a zip, paste it on the target computer B and boot everything and voilà.
None of this works properly.
I do manage to get an instance of Tandoor running on my new computer, it displays every recipe I had originally, but it has an issue when trying to create a new recipe. I get a white page with “Server Error (500)”. It does not happen on the original Tandoor, despite being all the same files in theory.
I noticed that on my source computer, the postgres DB directory changes permission when I start the container, as well as the directory containing the recipe pictures. So I’m wondering if wrong permissions might be corrupting data while copying stuff?
Thanks
OneCardboardBox@lemmy.sdf.org 1 year ago
Agree with the other user that using tar and then zipping the tarball will preserve permissions.
Alternatively, you could open an ssh connection and rsync the files between them.
Last option would be to export your recipes from the old host, build a new container from scratch on the new one, and import them back again: docs.tandoor.dev/features/import_export/
Natal@lemmy.world 1 year ago
I thought so, too. I played around with the tar idea and it led me to discover the permissions are wrong on the original computer. I have added new info on the main post about it but basically the owner is “user:70” and I have no idea where that comes from. I tried using CHOWN to reset everything to my own user, which is the same on both computers (1000:1000 uidguid), but whenever I restart the container, it locks again.
OneCardboardBox@lemmy.sdf.org 1 year ago
The user and group id inside the container doesn’t have to match any user on your host machine. It’s possible that user:70 is configured as the user to launch inside the container, in which case you should set the ownership of the directory to match what the container expects.
Eg: The container for my torrent client runs as user 700 group 700. My host machine does not have either of those IDs defined. My torrent directory must be chown’d by 700:700 or else the container can’t read/write torrents.
NullPointerException@lemm.ee 1 year ago
agreed, good find with that import/export feature, didn’t think to check for that since I don’t use tandoor. personally I’d just use the native import/export feature though since it feels less hacky than copying the whole DB imo. but if OP still wants to copy the files over, it might be easier to either just tar or tar + gzip rather than tar + zip so they can do it all in one command.