🔍 Quick Tip: Identify Migration Failures Instantly
When DataMigrationKit.Migrate returns success = false, the second return value is a structured error table—not a string. Check result.Code to determine the cause:
"TransformFailed"– your transform function raised an error. Inspectresult.Messageandresult.Detailsfor the exact Lua error."Throttled"– DataStore throttling occurred. The kit retries automatically, but you can inspectresult.Details.retryAfterfor the recommended wait time."CorruptedData"– The stored value failed validation inside the atomic framework. This usually means the data was manually corrupted outside the kit.
Example:
local ok, result = DataMigrationKit.Migrate("PlayerData", player.UserId, transformFn)
if not ok then
warn("Migration failed: " .. result.Code .. " – " .. result.Message)
if result.Code == "CorruptedData" then
-- Queue manual review or restore from backup
end
end
This single habit eliminates guesswork when migrations don't apply as expected.


