bepaald / signalbackup-tools

Tool to work with Signal Backup files.
GNU General Public License v3.0
755 stars 36 forks source link

Worth documenting a success story? (Signal Desktop messages to a Backup (for Android)) #211

Closed Harmelodic closed 4 months ago

Harmelodic commented 4 months ago

Setup:

My old Android phone died a couple of days ago. I had a backup file, but it was 2022 (stupid me for not being better at backups, I guess), but I still had all my messages in Signal Desktop!

I wanted to get those messages onto my new phone. No support from Signal, so I turned to this repo.

Saw that you had a section in the README on "Importing conversations from Signal-Desktop", so I tried running that.

I saw you needed an input Signal backup file, so I tried using that 2022 backup file that I had. It was ~12GB.

Ran the command:

signalbackup-tools signal-2022-05-13-05-35-40.backup 000000000000000000000000000000 --importfromdesktop --output signal-2024-05-08.backup

but got the error:

Failed to determine id of 'self'. Please pass `--setselfid "[phone]"' to set it manually

Thanks to the error message, the --help and digging through your code, I figured out I needed to run:

signalbackup-tools signal-2022-05-13-05-35-40.backup 000000000000000000000000000000 --importfromdesktop --setselfid "+46700000000" --output signal-2024-05-08.backup

(replace 000000000000000000000000000000 with my passphrase, replace +46700000000 with my phone number)

After a LOT of [Warning] messages, out popped a file (it was ~20GB). I loaded it onto my phone, opened Signal and tried restoring from the backup. Seemed to work fine initially (incidentally, Signal said the date for this backup file was "1 Jan 1970, 00:58") but then after the backup finished loading in... the entire Signal app crashed. I tried reopening and the app crashed after a few seconds... every time. I had to reinstall the Signal app.

After some troubleshooting and recreating the backup (and more app crashes), I eventually tried to just restore the 2022 backup to see if that would work. It didn't. It caused the app to crash after a few seconds, just like before.

Changing tactic, I tried opening Signal, logging in, giving Signal a couple of minutes join the groups I was in before, and then creating a basically empty backup file: signal-2024-05-08-19-35-31.backup.

Then ran the following command:

signalbackup-tools signal-2024-05-08-19-35-31.backup 000000000000000000000000000000 --importfromdesktop --autolimitdates --setselfid "+46700000000" --output signal-2024-05-08-19-38-00.backup

I used --autolimitdates since the new input backup file was newer than the messages and you had mentioned:

If your input backup file is newer than your Signal-Desktop data, the option --autolimitdates can be used to automatically only import messages from before the first message in the input backup.

That generated a new backup file (it was ~9.5GB). I loaded that onto my phone, went through the restore process and... no app crashes! And ALL messages seem to be there!

THANK YOU ❤️

Sent you a little donation to your Paypal 🤗

bepaald commented 4 months ago

Worth documenting a success story?

Yes, always happy to hear about these things.

Thanks to the error message, the --help and digging through your code, I figured out I needed to run:

Thanks, I think reading --help output (or the README) should be enough, if you needed to dig through the code I should improve the documentation. I'll take a look at that one of these days. (and maybe try to improve the function that scans for the self-id, maybe that can be improved as well)

After some troubleshooting and recreating the backup (and more app crashes), I eventually tried to just restore the 2022 backup to see if that would work. It didn't. It caused the app to crash after a few seconds, just like before.

Phew, that's a relief, haha. At least it wasn't this program that introduced an error in the backup file. Depending on what the problem was, the backup may be fixed with this program (though maybe that's not worth the trouble at this point).

That generated a new backup file (it was ~9.5GB). I loaded that onto my phone, went through the restore process and... no app crashes! And ALL messages seem to be there!

THANK YOU ❤️

Excellent! So glad you've got your message history back, that's why I wrote this program. I hope you won't need it again any time soon 😉.

Sent you a little donation to your Paypal 🤗

That is very much appreciated, thank you for you generous contribution!

Cheers!