docker-minecraft-bedrock-server icon indicating copy to clipboard operation
docker-minecraft-bedrock-server copied to clipboard

Backup worlds dir on update

Open fultonm opened this issue 2 years ago • 5 comments

Why don't we back up the worlds directory on server version update?

My playgroup runs the latest version of Preview, it seems high risk that a new server version could corrupt the world.

I have rolling backups set up daily for the whole disk, but it would be nice to have the latest pre-upgrade version of the world in the backup folder.

fultonm avatar Apr 20 '23 02:04 fultonm

That seems reasonable as an opt-in feature. I'd say it could do it always but people might have very large world data that would blow out volume space unexpectedly.

itzg avatar Apr 20 '23 03:04 itzg

I'd be happy to implement this 😀

Are you thinking an environment variable for the opt in?

Should we compress the world folder to save space? Not sure if the files are already using compression or if that would be effective. Can test later

fultonm avatar Apr 20 '23 18:04 fultonm

Cool. Yes an environment variable is what I'm thinking. Name I can think so far is UPGRADE_BACKUP_WORLD_DATA. As far as archive/compress, maybe that could be another variable like UPGRADE_BACKUP_ARCHIVE. Compression is probably effective, but large amounts of world data might take a little too long to compress.

itzg avatar Apr 20 '23 23:04 itzg

Cool. Yes an environment variable is what I'm thinking. Name I can think so far is UPGRADE_BACKUP_WORLD_DATA. As far as archive/compress, maybe that could be another variable like UPGRADE_BACKUP_ARCHIVE. Compression is probably effective, but large amounts of world data might take a little too long to compress.

What about ON_UPGRADE_WORLD_BACKUP or BACKUP_WORLD_ON_UPGRADE this make then env var self-explanatory.

Guillermo-Santos avatar Jun 27 '23 17:06 Guillermo-Santos

Haven’t forgotten about this but work and weekends are busy now. If someone wants to pick this up feel free. I’ll ping again when I can sit down and do it if still pending.

And I will also say I ran into a situation a couple weeks ago with a preview build that caused corruption with certain server.properties value. Luckily I had incremental backup set in Azure so I could restore, but it would have been nice to have the version from before upgrade in the folder :) we only lost ~6 hours of world data

fultonm avatar Jun 27 '23 17:06 fultonm