Hello ports@,

somebody in the Prosody MUC asked about using prosody-migrator. It's a
tool included in Prosody's source that allows for converting between
storage backends and replicating data. I gave it a quick test and seems
to work, so here's a patch for it.

OK?

        Lucas


diff refs/heads/master 6643302f195a5b98be8ef68aff0e1a85b1a51e42
commit - 9cea45611ab91c8e308e4380ed699f375ff7a409
commit + 6643302f195a5b98be8ef68aff0e1a85b1a51e42
blob - 0bc56d7633cdcb33cb0dd853eb5c642c2582ee30
blob + 28cdce856cbbf9fa0c6ea859c12bc5db81f63c96
--- net/prosody/Makefile
+++ net/prosody/Makefile
@@ -1,6 +1,6 @@
 COMMENT =      communications server for Jabber/XMPP written in Lua
 DISTNAME =     prosody-0.12.4
-REVISION =     0
+REVISION =     1
 CATEGORIES =   net
 HOMEPAGE =     https://prosody.im/
 
@@ -49,11 +49,15 @@ FAKE_FLAGS +=               
CONFIG=${DESTDIR}${PREFIX}/share/exampl
 
 pre-configure:
        cd ${WRKSRC}; sed -i -e 's,^#!/usr/bin/env lua,#!${MODLUA_BIN},' -e \
-               's,^lua ,${MODLUA_BIN} ,' prosody prosodyctl
+               's,^lua ,${MODLUA_BIN} ,' prosody prosodyctl \
+               tools/migration/prosody-migrator.lua
 
 post-patch:
        ${SUBST_CMD} ${WRKSRC}/util/prosodyctl.lua
 
+post-build:
+       cd ${WRKSRC}/tools/migration && make
+
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/prosody
        ${INSTALL_DATA} ${WRKSRC}/README \
@@ -61,6 +65,10 @@ post-install:
        ${INSTALL_DATA} ${WRKSRC}/certs/makefile \
                ${PREFIX}/share/examples/prosody/certs/Makefile
        ${INSTALL_DATA} ${WRKSRC}/certs/openssl.cnf \
-                ${PREFIX}/share/examples/prosody/certs
+               ${PREFIX}/share/examples/prosody/certs
+       ${INSTALL_SCRIPT} ${WRKSRC}/tools/migration/prosody-migrator.install \
+               ${PREFIX}/sbin/prosody-migrator
+       ${INSTALL_DATA} ${WRKSRC}/tools/migration/migrator.cfg.lua.install \
+               ${PREFIX}/share/examples/prosody/migrator.cfg.lua
 
 .include <bsd.port.mk>
blob - 7064c733d42d16906934cc69361c966c3e9b40b2
blob + 9eaa4c597962bd797a79dd90513a08d5b1aa5be6
--- net/prosody/pkg/PLIST
+++ net/prosody/pkg/PLIST
@@ -270,6 +270,7 @@ lib/prosody/util/xpcall.lua
 lib/prosody/util/xtemplate.lua
 @man man/man1/prosodyctl.1
 sbin/prosody
+sbin/prosody-migrator
 sbin/prosodyctl
 share/doc/pkg-readmes/${PKGSTEM}
 share/doc/prosody/
@@ -282,6 +283,8 @@ share/examples/prosody/certs/Makefile
 @sample ${SYSCONFDIR}/prosody/certs/Makefile
 share/examples/prosody/certs/openssl.cnf
 @sample ${SYSCONFDIR}/prosody/certs/openssl.cnf
+share/examples/prosody/migrator.cfg.lua
+@sample ${SYSCONFDIR}/prosody/migrator.cfg.lua
 share/examples/prosody/prosody.cfg.lua
 @sample ${SYSCONFDIR}/prosody/prosody.cfg.lua
 @mode 770
blob - 128e541036b83088608589645138cd485bfec37a
blob + ad138a0d4ca66908effd6cbf3843c4c41e2f154e
--- net/prosody/pkg/README
+++ net/prosody/pkg/README
@@ -6,7 +6,7 @@ Using Prosody in an OpenBSD environment
 
 1) Prosody documentation is available online at:
 
-   http://prosody.im/doc/configure
+   https://prosody.im/doc/configure
 
    Use this information to edit:
 
@@ -44,3 +44,11 @@ Using Prosody in an OpenBSD environment
    For MySQL/MariaDB, also add the following to /etc/login.conf:
 
    prosody:setenv=LD_PRELOAD=/usr/lib/libpthread.so:tc=daemon:
+
+6) It's possible to copy and convert storage backends with:
+
+   # ${TRUEPREFIX}/sbin/prosody-migrator
+
+   The online documentation can be found at:
+
+   https://prosody.im/doc/migrator

Reply via email to