aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-09 16:35:43 +0100
committerKim Alvefur <zash@zash.se>2022-01-09 16:35:43 +0100
commitf04a5512a7f9b81cffa5d986a0491c5ba3050cbf (patch)
treec9f0db9cf8681119dceb1abe7325fe5b5d3cb71b /tools/migration
parentb21bc2b374353ca562d95dfd574fed59206312b3 (diff)
downloadprosody-f04a5512a7f9b81cffa5d986a0491c5ba3050cbf.tar.gz
prosody-f04a5512a7f9b81cffa5d986a0491c5ba3050cbf.zip
migrator: Enhance logging
Diffstat (limited to 'tools/migration')
-rw-r--r--tools/migration/prosody-migrator.lua15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua
index 57d87e20..82b46d5a 100644
--- a/tools/migration/prosody-migrator.lua
+++ b/tools/migration/prosody-migrator.lua
@@ -150,8 +150,10 @@ local um = require "core.usermanager";
local function users(store, host)
if store.users then
+ log("debug", "Using store user iterator")
return store:users();
else
+ log("debug", "Using usermanagre user iterator")
return um.users(host);
end
end
@@ -186,12 +188,16 @@ local migrate_once = {
if options["keep-going"] then
local xpcall = require "util.xpcall".xpcall;
- local function log_err(err)
- log("error", "Error migrating data: %s", err);
- log("debug", "%s", debug.traceback());
- end
for t, f in pairs(migrate_once) do
migrate_once[t] = function (origin, destination, user)
+ local function log_err(err)
+ if user then
+ log("error", "Error migrating data for user %q: %s", user, err);
+ else
+ log("error", "Error migrating data for host: %s", err);
+ end
+ log("debug", "%s", debug.traceback(nil, 2));
+ end
xpcall(f, log_err, origin, destination, user);
end
end
@@ -220,6 +226,7 @@ local migration_runner = async.runner(function (job)
migrate(origin, destination, nil); -- host data
for user in users(origin, host) do
+ log("info", "Migrating user %s@%s store %s (%s)", user, host, store, typ);
migrate(origin, destination, user);
end
end