PwnAdventure3 icon indicating copy to clipboard operation
PwnAdventure3 copied to clipboard

How to backup the server database when using container.

Open codec-abc opened this issue 6 years ago • 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?

codec-abc avatar Jul 27 '18 15:07 codec-abc

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

JavaProgrammerLB avatar Aug 29 '18 06:08 JavaProgrammerLB

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.

codec-abc avatar Aug 29 '18 11:08 codec-abc

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

TheGreyDiamond avatar Mar 05 '19 19:03 TheGreyDiamond

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.

timothyleung1 avatar Oct 06 '19 03:10 timothyleung1

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.

NerusSkyhigh avatar Oct 20 '21 22:10 NerusSkyhigh