Archive Matrix room messages.
Creates a CSV log of all room messages, including media.
Note that at least Python 3.8+ is required.
-
Install libolm 3.1+
-
Debian 11+ (testing/sid) or Ubuntu 19.10+:
sudo apt install libolm-dev
-
Archlinux based distribution can install the
libolm
package from the Community repository -
macOS
brew install libolm
-
Failing any of the above refer to the olm repo for build instructions.
-
-
Clone the repo and install dependencies
- Install
pip
if not done
git clone git@github.com:jicheu/matrix-archive.git cd matrix-archive # Optional: create a virtualenv python -m venv venv && source venv/bin/activate pip install -r requirements.txt
- Install
-
Download your E2E room keys: in the client Element you can do this by clicking on your profile icon, Security & privacy, Export E2E room keys.
The file can be placed on:
- .env directory under the name @id.keys
- anywhere if you provide the path with --keys
- in /tmp to be copied by the script itself
- Run export.sh with the following parameters:
export.sh --user=USERID --password=USERPASS --keys=KEYFILES --keyspass=KEYSPASS --server=SERVER URL [--media | --no-media ] --all-rooms
- You will get your archive in a tgz format
- Add
--list-rooms
instead of--all-rooms
will generate a list of room id You can then replace all rooms option by a series of--room=
followed by the room id without the initial ! such as in:
/export.sh --user=my user --password=mypassword --keys=keyfile --keyspass=keypass --server=serverurl --room="NStMnAUWAIfVdYHsAm" --room="btYyveaTqxTRUbFSAj"
A file named .env/room_list.@userid.txt
will be create with the ids you can use later
Add --my-rooms
to reload the same rooms as previously selected. If no rooms file is found, the list will be displayed for selection (similar to List rooms above)
/export.sh --user=my user --password=mypassword --keys=keyfile --keyspass=keypass --server=serverurl --my-rooms
The backup archive is put in .target
directory under the name user_id.tgz