Skip to content

alexlance/signal-sms-mms-importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SMS and MMS import into Signal Messenger

Turns out it's really hard to import your old MMS messages into Signal - this process will help you merge in your SMS, MMS and Signal messages together in Signal, so you can delete your Android system SMS/MMS store and make Signal your default SMS app without losing any of your SMS and MMS history.

The script in this repo takes an XML file - as generated by SMS Backup and Restore (by SyncTech), and uses https://github.com/bepaald/signalbackup-tools to dissect a normal Signal backup file, and re-construct it again with all the messages from the SMS Backup and Restore XML file imported.

Caveats

  • Only tested on Android
  • The commands below were run on Linux, have also tested Windows equivalents
  • Before you begin make sure you:
    • backup Signal before you begin
    • have written down the 30 digit backup code
    • still have your phone number for identity verification
    • still remember your numerical Signal Pin

Instructions

  1. Generate a Signal backup file
Signal -> Chats -> Backups -> Local Backup
  1. Transfer that file to your computer, file will be named eg: signal-2022-06-10-17-00-00.backup

  2. Run signalback-tools over the Signal backup file, eg:

  # Install signalbackup-tools
  git clone https://github.com/bepaald/signalbackup-tools ... (follow their directions for installation)
  # On Windows, download binary from https://github.com/bepaald/signalbackup-tools/releases and put in same folder as .backup

  # Signal 30 digit backup passphrase
  key=123451234512345123451234512345
  # Windows version of the last command:
  # set key=123451234512345123451234512345

  # Create a directory to store the dissected Signal backup
  mkdir bits
  # Windows version of the last command:
  # md bits

  # Use signalbackup-tools to dissect the Signal backup
  ./signalbackup-tools ./signal-2022-06-10-17-00-00.backup ${key} --output bits/
  # Windows version of the last command:
  # signalbackup-tools_win.exe -i signal-2022-06-10-17-00-00.backup -o bits -p %key%
  1. Generate an SMS Backup and Restore (SyncTech) XML file on your phone and transfer that to a computer. Ensure the backup includes SMS and MMS, if that's what you want to import into Signal.

  2. Run the script in this repo over the XML file:

python3 sms-mms-import-to-signal.py sms-20220611130220.xml bits
python3 sms-mms-import-to-signal.py --input sms-20220611130220.xml --output bits -m -v
  1. Use signalbackup-tools to wrap up the new Signal backup file:
# note: file suffix of signal backup files *must* be ".backup"
signalbackup-tools bits/ --output ./signal.backup --opassword ${key}
# Windows version of the last command:
# signalbackup-tools_win.exe bits --output signal.backup --opassword %key%
  1. Transfer the signal.backup file back to your phone

  2. Delete Signal from your phone (only if you're 100% confident that you can use your original backup if things don't work!)

  3. Reinstall Signal, it'll ask you if you've got a backup file that you want to restore from. You will need:

    1. The 30 digit passcode
    2. A phone number that you can receive their validation code on
    3. The Signal PIN number that you may have setup
  4. Open Signal, you should see all your SMS messages and MMS messages, as well as your normal Signal messages, all in Signal now.

  5. Once you're 100% certain everything looks great, my next steps were to use SMS Backup and Restore -> Tools section to erase all SMS/MMS messages, and change the default SMS messaging app over to Signal.

Thoughts

  • Feel free to shout out with any issues problems in github issues
  • Make sure to go and give signalbackup-tools some kudos as they do most of the heavy lifting
  • Wonder if we could move whatsapp messages using a similar procedure... ?

Additions from github user @wearepariah:

  • Adapted import to properly handle RCS messages sent/received
  • Imported SMS/MMS look like SMS/MMS in signal, rather than signal messages
  • Added 'add recipient' function, to import all SMS/MMS rather than only those with contacts
  • Modified from tuples to dictionaries for readability
  • Switched from print to logger for capturing logs/outputs
  • Modified thread count logic to include SMS & MMS, aggregated at the end
  • Added merge function, to reprocess the import of a previously imported SMS/MMS XML backup
  • Added arguments for input & output, but maintained positional for compatability
  • Added merge & verbose arguments for finer control
  • Various other readability, performance, sql updates to better mimic how Signal loads SMS/MMS into it's databases

To do

  • finish mms/rcs message import correction
  • make them dictionaries instead of lists where possible (readability/performance)
  • make a reliable equivalent to oracle merge? delete/add? update? optional arguments/yesno prompts to ask about the 'delete equivalent things' prcoess?
  • create recipient when not exist?
  • have mms/sms appear as such in signal, not as signal messages
  • handle group things so messages are associated to the sender/each recipient
    • Maybe import group/bulk texts as signal groups? Do we care? MMS group texts don't really function like a group chat in the real world from my experience
  • Currently, imported audio messages don't play - have seen some comments on signalbackup-tools that indicate it may not be to do with our import?
  • the thread snippet sometimes shows an old message - might be worth adding something at the end to deal with that?
  • add the sha256 hash to the data_hash field in part table

About

Import SMS and MMS into Signal Messenger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published