LiveOverflow/PwnAdventure3

How to backup the server database when using container.

codec-abc opened this issue · 5 comments

Hi,

Assuming that I followed the docker compose and got a server running properly, how can I backup and restore the database to a fresh new container?

hi, @codec-abc ,do you get the way to backup the server database, I have the same question

No, but it was not such a big deal in the end. Because once you got a speed/teleport hack you can go everywhere pretty quickly and since most quests can be done without stuff you don't lose that much time by starting from scratch.

So there is no way to save the progress when using docker?

Probably its because the docker design changed. When you type control+c after docker-compose up
It should technically send a SIGINT signal to the script in script/masterserver.sh and it will then store your current status using a dump, and then reload it later on when you run docker-compose up. I couldn't manage to fix the script, but you can technically run docker ps to find the masterserver id , then execute docker exec -it <id> /bin/sh and kill the process yourself to generate the .sql file which stores your game, you can run kill 1 to do that. You should then able to see a message in the other window, the window that you ran docker-compose up, saying a .sql is generated.

I know this is an old issue but it might help someone else:
For me, it was sufficient to comment drops in "./server/MasterServer/initdb.sql" and stop the container with "docker-compose down" from another shell. This sends the right signal to the "masterserver.sh" script and allows it to back up the data. Note: if you created the folder "postgres-data" by hand you need to give the docker user the right permissions.