Skip to content

Proper World Migration for existing Worlds#13722

Open
OstlerDev wants to merge 1 commit intoPaperMC:dev/26.1from
OstlerDev:dev/26.1-world-migration
Open

Proper World Migration for existing Worlds#13722
OstlerDev wants to merge 1 commit intoPaperMC:dev/26.1from
OstlerDev:dev/26.1-world-migration

Conversation

@OstlerDev
Copy link

Summary

World migration for existing worlds was completely broken, and we were not using the new folder layouts, instead defaulting to falling back to the legacy world folder structure, causing existing worlds to be inaccessible.

Fixes

  • fixed migration for 26.1 split world storage by using the correct split folder structure/layout
  • add regression tests for both behaviors

I have verified migration now succeeds as expected in all of the broken scenarios that were seen previously.

  • Paper 1.21.11 -> Paper 26.1
  • Vanilla 1.21.11 -> Paper 26.1
  • Vanilla 26.1 -> Paper 26.1

The Problem

Paper 26.1 seemed to only be looking for the old folder structure when actually loading the files. I tested out a few different migration scenarios and found the following results.

Vanilla 1.21.11 -> Paper 26.1 & Vanilla 26.1 -> Paper 26.1

All dimensions are completely inaccessible.

All region/world files for each of the three worlds/dimensions end up nested inside world/dimensions/minecraft, causing the Overworld, Nether, and End to regenerate. The region/world files do still exist, however are improperly referenced, causing none of the existing worlds to be accessible.

Paper creates/uses the old world/region, world_nether/DIM-1/region, and world_the_end/DIM1/region paths instead of the new migrated file paths. It does not properly split out the world dimension files into each of their individual world folders.

Paper 1.21.11 -> Paper 26.1

Migrating a PaperMC 1.21.11 split world structure was a little better in that it did partially reorganize both world and world_nether into their respective new structures, however it still referenced the old world paths for DIM-1 and DIM1, which was causing the server to just hard crash when it was unable to find the expected files. If it had finished starting up, the world dimensions still would have been inaccessible for the above issues with the Vanilla file migration, since Paper 26.1 just wasn't loading the files from the proper location even though the migration had been triggered.

Logs:

...
[16:12:30 INFO]: Starting upgrade for world "world"
[16:12:30 INFO]: Upgrading progress: 2%
[16:12:30 INFO]: File system capabilities: FileSystemCapabilities[atomicMove=true, hardLinks=true]
[16:12:31 INFO]: Applying file structure changes for world "world"
[16:12:31 INFO]: Moving new hardlinked world to top level
[16:12:31 INFO]: Start cleanup
[16:12:31 INFO]: Moving out old world folder
[16:12:31 INFO]: Moving in new world folder
[16:12:31 INFO]: Done applying file structure changes for world "world". Cleaning up outdated data...
[16:12:32 INFO]: Upgrade done for world "world"
[16:12:32 INFO]: Loaded 1515 recipes
[16:12:32 INFO]: Loaded 1617 advancements
[16:12:32 INFO]: Starting minecraft server version 26.1
[16:12:32 INFO]: Loading properties
[16:12:32 INFO]: This server is running Paper version 26.1-DEV-dev/26.1@dfa3e44 (1970-01-01T00:00:00Z) (Implementing API version 26.1-R0.1-SNAPSHOT)
[16:12:32 INFO]: [spark] This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling
[16:12:32 INFO]: Server Ping Player Sample Count: 12
[16:12:32 INFO]: Using 4 threads for Netty based IO
[16:12:32 INFO]: [MoonriseCommon] Paper is using 3 worker threads, 1 I/O threads
[16:12:32 INFO]: Default game type: SURVIVAL
[16:12:32 INFO]: Generating keypair
[16:12:32 INFO]: Starting Minecraft server on *:25565
[16:12:33 INFO]: Paper: Using libdeflate (macOS ARM64 / Apple Silicon) compression from Velocity.
[16:12:33 INFO]: Paper: Using native (macOS ARM64 / Apple Silicon) cipher from Velocity.
...
[16:12:34 INFO]: Preparing level "world"
[16:12:34 INFO]: Starting upgrade for world "world_nether"
[16:12:34 INFO]: Upgrading progress: 2%
[16:12:34 INFO]: File system capabilities: FileSystemCapabilities[atomicMove=true, hardLinks=true]
[16:12:34 INFO]: Applying file structure changes for world "world_nether"
[16:12:34 INFO]: Moving new hardlinked world to top level
[16:12:34 INFO]: Start cleanup
[16:12:34 INFO]: Moving out old world folder
[16:12:34 INFO]: Moving in new world folder
[16:12:34 INFO]: Done applying file structure changes for world "world_nether". Cleaning up outdated data...
[16:12:34 INFO]: Upgrade done for world "world_nether"
[16:12:34 ERROR]: Unable to read or access the world gen settings file! Falling back to the default settings with a random world seed. ./world_nether/DIM-1/data/minecraft/world_gen_settings.dat
[16:12:34 ERROR]: Encountered an unexpected exception
java.lang.IllegalStateException: Overworld settings missing
	at net.minecraft.world.level.levelgen.WorldDimensions.<init>(WorldDimensions.java:47) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.world.level.levelgen.WorldDimensions.<init>(WorldDimensions.java:54) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.world.level.storage.LevelStorageSource.lambda$getLevelDataAndDimensions$0(LevelStorageSource.java:165) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at com.mojang.serialization.DataResult$Error.mapOrElse(DataResult.java:309) ~[datafixerupper-9.0.19.jar:?]
	at net.minecraft.world.level.storage.LevelStorageSource.getLevelDataAndDimensions(LevelStorageSource.java:158) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at io.papermc.paper.world.PaperWorldLoader.loadInitialWorlds(PaperWorldLoader.java:144) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:548) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:382) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1145) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303) ~[paper-26.1.jar:26.1-DEV-dfa3e44]
	at java.base/java.lang.Thread.run(Thread.java:1474) ~[?:?]

Fixes issues where world migration was not happening properly for nether and end dimensions. Also fixes the shared-data routing for scoreboard/maps.
@OstlerDev OstlerDev requested a review from a team as a code owner March 25, 2026 22:50
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Mar 25, 2026
@OstlerDev
Copy link
Author

OstlerDev commented Mar 25, 2026

I had reviewed the contributor documentation to try and understand the right branch to open my PR against. I understand if the code is not something that will be used or implemented, since I know you all prefer to implement it yourselves when they are new dev/snapshot/version branches. No worries if help is not desired for implementing the world migration support, from what I could tell in #⁠paper-contrib there was difficulty with finding time/team resources to dedicate to rewrite the migration code.

Feel free to close the PR if it is not helpful and/or if it is not desired at this time. I wasn't sure the best way to communicate with the dev team to see if help was wanted in that area, and I guess I should have done that first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

1 participant