Banner Image

Dane Kouttron

Project Started: 01/2024

Restoring Android signal DB from desktop files

So your Signal / Molly update failed and it's looking like you're going to need to re-install and loose all those old messages. You want those old messages. You have the Desktop application installed with all the messages visible but how the heck can you take those messages and knit back together a valid signal / molly backup file?

Put on your hackerman gloves we're in for an adventure

Some Background

My situation was as follows:

Signal desktop WIN X64 is installed and running, I was running the open source variant of Android Signal [Molly Foss]. I'm out on a walk and Molly wanted to update, i hit go and kept on walking. Molly did not update correctly and was stuck in a loop 'updating' then crashing. I had not known about scheduled backups and this is not set by default. If I were to uninstall the android application and then reinstall, it would begin a new db and the accounts linked to this would no longer be valid. The linked account data is still visible on my X64 desktop installation.

I want to take the information in my Signal Desktop application and generate a valid backup file that Android Signal / Molly can use to re-generate old chats. This is not possible by default in the app, but since when did that stop anything.

bumper sticker

It's goofy how asymetric the signal environment is, it's heavily based on having access to a cellular phone and nominally that is the 2FA authentication source. Signal desktop on its own has no functionality without being paired to a phone.

Step 1: Take a minute and collect files

You have all the chat's in the desktop app, let's close that application and make a copy of the files, this is your source material. Ensure the application is closed, and verify with task manager.

Navigate to: C:/Users/< Username >/AppData/Roaming/Signal/

In windows this is a hidden folder, so enable viewing hidden folders. Copy this directory to C:/signal_fix . We are only copying this in the off chance something goes wrong.

Step 2: Generate a valid backup on Android

This is a painful step, uninstall molly / signal on your android device. Reinstall. On re-install, we're going to need to generate a passkey for your new install. This is a 30 character string. After your account is setup, enable backups. It's important at this point to allow this "new" install access to your contacts, as those contacts get matched up to the contacts from your desktop backup. Select a folder for the backup and ensure a backup is generated. This backup is mostly blank as it does not have your previous account information.

Step 3: Copy the backup file and new passkey

Connect your phone over USB and mount it as a file system. Copy your new, fairly empty backup file to C:/signal_fix. It should look like molly-2024-01-29-22-50-47.backup , populated with whatever the date of the backup is. Next let's grab signalbackup tools from [signal Backup tools on github]. An executable for windows is available here [Windows releases]. Copy signalbackup-tools_win.exe to C:/signal_fix. You now have everything you need to perform your signal data necromancy

Step 4: Command Prompt

Open a command prompt and navigate to C:\signal_fix Replace the 30 characters of 0 with your passkey.

C:\signal_fix>signalbackup-tools_win.exe molly-2024-01-29-22-50-47.backup 000000000000000000000000000000 --importfromdesktop --output [new_database_output]

If you're running the normal signal desktop path, signal backup tools will grab the C:/Users/< Username >/AppData/Roaming/Signal/ files to rebuild a backup file, using the basically empty backup file as a reference. If your signal install is somewhere else, make you life easier and just copy those files to that location. This can take a bit of time, as shown below, so be patient.

Step 5: Copy and import

The output you just created will be called new_database_output. It's really a backup file. lets re-name this to match with the nomenclature of the old backup file, in this case i renamed the file and incremented the time a bit "molly-2024-01-29-22-50-48.backup". With your phone mounted over USB, copy this file into the directory you had chosen for signal backups to be stored. For me, this file was ~800mb and file transfering over USB was easiest. Next up you need to try and restore from a backup. Open your new copy of signal and select restore from backup. This may again require a fresh install of the signal / molly app.

bumper sticker

Point your new signal / molly install at the restore file you generated and give the phone some time to injest this file as it may be large. After a bit your phone will tell you that the backup was restored. At this point your old messages have re-appeared on-phone. But what about Desktop? At this point, desktop is now un-linked from your account and you need to go through the re-linking as normal. Guess what though, everything should still be there.

bumper sticker

Old messages are back and visible without an issue. Group messages are spotty, some imported without issues and some did not show up correctly, but individual messages were visible without issue.

Concluding Remarks:

  • This was stressful, if I had known about scheduled backups this would not have been an issue.

  • Probably a good time to schedule backups on android

Have you noticed that there are no advertisements or ridiculous pop ups?

No cookie banner or newsletter?

I'm trying to make a better web, feel free to support it.

Want More?

Here's a behind the scenes look at my work space and some of the images that did not make the cut to be included in the write-up:

If you have questions or comments, ask below or send an email

Post your comments!

Comment Box loading