aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration
diff options
context:
space:
mode:
Diffstat (limited to 'tools/migration')
-rw-r--r--tools/migration/migrator.cfg.lua10
-rw-r--r--tools/migration/migrator/jabberd14.lua7
-rw-r--r--tools/migration/prosody-migrator.lua27
3 files changed, 33 insertions, 11 deletions
diff --git a/tools/migration/migrator.cfg.lua b/tools/migration/migrator.cfg.lua
index b81389b3..6e29b9b8 100644
--- a/tools/migration/migrator.cfg.lua
+++ b/tools/migration/migrator.cfg.lua
@@ -3,6 +3,7 @@ local data_path = "../../data";
local vhost = {
"accounts",
"account_details",
+ "account_roles",
"roster",
"vcard",
"private",
@@ -12,18 +13,27 @@ local vhost = {
"offline-archive",
"pubsub_nodes-pubsub",
"pep-pubsub",
+ "cron",
+ "smacks_h",
}
local muc = {
"persistent",
"config",
"state",
"muc_log-archive",
+ "cron",
};
+local upload = {
+ "uploads-archive",
+ "upload_stats",
+ "cron",
+}
input {
hosts = {
["example.com"] = vhost;
["conference.example.com"] = muc;
+ ["share.example.com"] = upload;
};
type = "internal";
path = data_path;
diff --git a/tools/migration/migrator/jabberd14.lua b/tools/migration/migrator/jabberd14.lua
index a4eef3f7..7edb887c 100644
--- a/tools/migration/migrator/jabberd14.lua
+++ b/tools/migration/migrator/jabberd14.lua
@@ -1,7 +1,10 @@
+if not pcall(require, "prosody.loader") then
+ pcall(require, "loader");
+end
local lfs = require "lfs";
-local st = require "util.stanza";
-local parse_xml = require "util.xml".parse;
+local st = require "prosody.util.stanza";
+local parse_xml = require "prosody.util.xml".parse;
local os_getenv = os.getenv;
local io_open = io.open;
local assert = assert;
diff --git a/tools/migration/prosody-migrator.lua b/tools/migration/prosody-migrator.lua
index 21eb32e7..467ecf32 100644
--- a/tools/migration/prosody-migrator.lua
+++ b/tools/migration/prosody-migrator.lua
@@ -43,7 +43,11 @@ local function usage()
print("If no stores are specified, 'input' and 'output' are used.");
end
-local startup = require "util.startup";
+if not pcall(require, "prosody.loader") then
+ pcall(require, "loader");
+end
+
+local startup = require "prosody.util.startup";
do
startup.parse_args({
short_params = { v = "verbose", h = "help", ["?"] = "help" };
@@ -79,7 +83,7 @@ end
-- Command-line parsing
local options = prosody.opts;
-local envloadfile = require "util.envload".envloadfile;
+local envloadfile = require "prosody.util.envload".envloadfile;
local config_file = options.config or default_config;
local from_store = arg[1] or "input";
@@ -132,8 +136,8 @@ if have_err then
os.exit(1);
end
-local async = require "util.async";
-local server = require "net.server";
+local async = require "prosody.util.async";
+local server = require "prosody.net.server";
local watchers = {
error = function (_, err)
error(err);
@@ -143,10 +147,10 @@ local watchers = {
end;
};
-local cm = require "core.configmanager";
-local hm = require "core.hostmanager";
-local sm = require "core.storagemanager";
-local um = require "core.usermanager";
+local cm = require "prosody.core.configmanager";
+local hm = require "prosody.core.hostmanager";
+local sm = require "prosody.core.storagemanager";
+local um = require "prosody.core.usermanager";
local function users(store, host)
if store.users then
@@ -164,6 +168,11 @@ local function prepare_config(host, conf)
elseif conf.type == "sql" then
cm.set(host, "sql", conf);
end
+ if type(conf.config) == "table" then
+ for option, value in pairs(conf.config) do
+ cm.set(host, option, value);
+ end
+ end
end
local function get_driver(host, conf)
@@ -200,7 +209,7 @@ migrate_once.pubsub = function(origin, destination, user, prefix, input_driver,
end
if options["keep-going"] then
- local xpcall = require "util.xpcall".xpcall;
+ local xpcall = require "prosody.util.xpcall".xpcall;
for t, f in pairs(migrate_once) do
migrate_once[t] = function (origin, destination, user, ...)
local function log_err(err)