# HG changeset patch # User Kim Alvefur # Date 1611677924 -3600 # Node ID a16b689525d7e07d96fd5142b79344f68ce79abe # Parent 6e0aa163298fa3f5b3c3b33de2d0f98aa2c31ae6 mod_migrate: Allow migrating data not attached to any user / nil user Certain data more related to the server itself is stored with user = nil diff -r 6e0aa163298f -r a16b689525d7 mod_migrate/mod_migrate.lua --- a/mod_migrate/mod_migrate.lua Tue Jan 26 17:17:36 2021 +0100 +++ b/mod_migrate/mod_migrate.lua Tue Jan 26 17:18:44 2021 +0100 @@ -28,6 +28,7 @@ local function migrate_user(username) module:log("info", "Migrating %s data for %s", source_store, username); + if username == "" then username = nil; end local data, err = storage:get(username); if not data and err then module:log("error", "Could not read data: %s", err); @@ -42,6 +43,7 @@ if store_type == "archive" then function migrate_user(username) module:log("info", "Migrating %s archive items for %s", source_store, username); + if username == "" then username = nil; end local count, errs = 0, 0; for id, item, when, with in storage:find(username) do local ok, err = target:append(username, id, item, when, with);