c9039a5ad2
Include a script and documentation for switching to the MAM module shipped with ejabberd 15.06 and newer. |
||
---|---|---|
.. | ||
README.md | ||
import-mam-archives |
README.md
mod_mam_mnesia
Current Status
This module is deprecated.
ejabberd 15.06 and newer ships a mod_mam
module which supports Mnesia
and SQL/ODBC storage. It is recommended to use that module, as
mod_mam_mnesia
is no longer supported. Existing mod_mam_mnesia
tables can be imported into mod_mam
using the import-mam-archives
script, as described below.
Migrating to mod_mam
You might want to log off your users during the migration. However, note that importing the MAM archives might take up to a few hours.
Also note that with mod_mam
, the total size of all MAM archives cannot
exceed 2 GB. The delete_old_mam_messages
command could be run
periodically to make sure the Mnesia data won't grow beyond that limit.
To support larger archives, SQL/ODBC storage must be used.
-
In your ejabberd.yml file, replace
mod_mam_mnesia
withmod_mam
, and adjust the configuration of that module.mod_mam
supports a different set of options, so you should check the documentation. Since ejabberd 16.02,mod_mam
supports therequest_activates_archiving
option, but it's not enabled by default. To mimicmod_mam_mnesia
's default behavior, you could configuremod_mam
like this:modules: mod_mam: default: always request_activates_archiving: true
-
Check the node name of your server by running
ejabberdctl status
. If the name is notejabberd@localhost
, you must replace thelocalhost
part of the two node names at the top of the script with the host name part of your ejabberd node. -
The
import-mam-archives
script removes themod_mam_mnesia
tables after importing them intomod_mam
. Therefore, you should take a backup of your MAM archives (and the other Mnesia data) by running a command such as:ejabberdctl dump $HOME/ejabberd-backup.dat
-
Download and run the import script:
chmod +x import-mam-archives ./import-mam-archives
If only the messages stored during the last
N
days should be imported, run./import-mam-archives N
instead. -
Restart ejabberd.