Package: signal-export
signal-exportExport chats from theSignalDesktop appto Markdown and HTML files with attachments. Each chat is exported as an individual .md/.html file and the attachments for each are stored in a separate folder. Attachments are linked from the Markdown files and displayed in the HTML (pictures, videos, voice notes).Currently this seems to be the only way to get chat history out of Signal!Adapted frommattsta/signal-backup, which I suspect will be hard to get working now.ExampleAn export for a group conversation looks as follows:[2019-05-29, 15:04] Me: How is everyone?
[2019-05-29, 15:10] Aya: We're great!
[2019-05-29, 15:20] Jim: I'm not.Images are attached inline with![name](path)while other attachments (voice notes, videos, documents) are included as links like[name](path)so a click will take you to the file.This is converted to HTML at the end so it can be opened with any web browser. The stylesheet.cssis still very basic but I'll get to it sooner or later.🚀 Installation with DockerThis tool has some pretty difficult dependencies, so it's easier to get some help from Docker.
For most people this will probably be the easiest way.
It requires installing Docker and then pulling a200MB image, so avoid this if data use is a concern.First off,install Docker(including following thepost-installation stepsfor managing Docker as a non-root user).And make sure you have Python installed.Then install this package:pipinstallsignal-exportThen run the script!
It will do some Docker stuff under the hood to get your data out of the encrypted database.sigexport~/signal-chats# output will be saved to the supplied directoryNBOn Windows/PowerShell, you may get an error liketerm 'sigexport' is not recognized, in which case you can use the following:python-msigexport.main~/signal-chatsUsagePlease fully exit your Signal app before proceeding, otherwise you will likely encounter anI/O diskerror, due to the message database being made read-only, as it was being accessed by the app.See the full help info:sigexport--helpDisable pagination on HTML, and overwrite anything at the destination:sigexport--paginate=0--overwrite~/signal-chatsList available chats and exit:sigexport--list-chatsExport only the selected chats:sigexport--chats=Jim,Aya~/signal-chatsYou can add--source /path/to/source/dir/if the script doesn't manage to find the Signal config location.
Default locations per OS are below.
The directory should contain a folder calledsqlwithdb.sqliteinside it.Linux:~/.config/Signal/macOS:~/Library/Application Support/Signal/Windows:~/AppData/Roaming/Signal/You can also use--old /previously/exported/dir/to merge the new export with a previous one.Nothing will be overwritten!It will put the combined results in whatever output directory you specified and leave your previos export untouched.
Exercise is left to the reader to verify that all went well before deleting the previous one.🗻 No-Python installI don't recommend this, and you will have issues with file-ownership and other stuff.
You can also run the Docker image directly, it just requires copy-pasting a much-longer command and being careful with volume mounts.First set the appropriate environment variables for your OS:# Only enter one of these!SIGNAL_INPUT="$HOME/.config/Signal"# LinuxSIGNAL_INPUT="$HOME/snap/signal-desktop/current/.config/Signal"# SnapSIGNAL_INPUT="$HOME/Library/Application Support/Signal"# macOSSIGNAL_INPUT="$HOME/AppData/Roaming/Signal"# Powershell# And your output location (must be an absolute path)SIGNAL_OUTPUT="$HOME/Downloads/signal-output"Then run the below command, which pulls in the environment variables you set above.# Note that the --overwrite flag is necessary when running like this# careful where you point it!dockerrun--rm\--netnone\-v"$SIGNAL_INPUT:/Signal:ro"\-v"$SIGNAL_OUTPUT:/output"\carderne/sigexport:latest\--overwrite/output\# this line is obligatory!--chatsJim# this line isn't🗻 BYOD (Build-Your-Own-Docker) imageRunning this script using the methods above requires you to trust that I haven't snuck anything into the Docker image.
You can inspect the code in this repo, and afterpip installing, you can confirm that the code installed on your computer matches this repo.
But the methods above rely on theDocker image, which is a bit more complex.You can check theDockerfilein this repo, and theGitHub Actions workflow.
You can check that the lastActions runmatches the time on the last push to the DockerHub registry.
But you can't guarantee that I didn't sneak something in, so the next thing is to check the image itself.So you can rundocker inspect carderne/sigexportand check theEntrypointandCmdvalues.
Then you can rundocker run --rm -it --entrypoint='' carderne/sigexport bashand check what Entrypoint/Cmd values correspond to inside the container, and check thatthatmatches the repo!You can also just build your own Docker image from this repo:gitclonehttps://github.com/carderne/signal-export.gitcdsignal-export
dockerbuild-tyourname/sigexport.Andthenrun the Python script, but tell it to use the image you just created:sigexport--docker-imageyourname/sigexportoutputdir/🌋 No-Docker installThis is hard mode, and involves installing more stuff.
Probably easy on macOS, slightly involved on Linux, and impossible on Windows.Before you can installsignal-export, you need to getsqlcipherworking.
Follow the instructions for your OS:Ubuntu (other distros can adapt to their package manager)Install the required libraries.sudoaptinstalllibsqlite3-devtclshlibssl-devThen clonesqlcipherand install it:gitclonehttps://github.com/sqlcipher/sqlcipher.gitcdsqlcipher
./configure--enable-tempstore=yesCFLAGS="-DSQLITE_HAS_CODEC"LDFLAGS="-lcrypto -lsqlite3"make&&sudomakeinstallmacOSInstallHomebrew.Runbrew install openssl sqlcipherWindowsUbuntu on WSL2 should work!
That is, install WSL2 and Ubuntu on Windows, and then follow theFor Linuxinstructions and feel your way forward.
But probably just give up here and use the Docker method instead.Install signal-exportThen you're ready to install signal-export:
(Note the[sql]that has been added!)pipinstallsignal-export[sql]Then you should be able to use theUsage instructionsas above.Developmentgitclonehttps://github.com/carderne/signal-export.gitcdsignal-export
pipinstall-e.[dev,sql]pre-commitinstallRun tests with:maketestAnd check types with:mypysigexport/Similar thingssignal-backup-decodemight be easier if you use Android!signal2htmlalso Android only