-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to import database into android after merging with desktop #233
Comments
Hi! Thanks for reporting, sorry to hear you are having trouble. I don't see anything obvious in those warnings and errors that would really cause the backup to be corrupt. The only really ugly error is this one:
Which I will try to find and fix shortly. But that too would not cause a failure to import. In fact, I'm not too sure this is a bug caused by the desktop-import at all. There are known problems with restoring older backups in Signal (specifically backups from 2022 even, see Signal-Android#13506). Does the crash happen quickly, or does it actually show some percentage of restoring messages before? If you look at the full Really the way to go here is to restore the original (untouched by this program) 2022 backup on Signal and verify it works correctly. If it does, there is indeed a bug in this tool, but at least you'll have a fully migrated up-to-date backup to import into. If it still crashes, the problem is not this tool and you should probably open an issue with Signal-Android.
As per the note in that file:
I do not necessarily plan to support proper full migrations, because:
The obvious way to migrate your database, as mentioned above, is to let Signal do it. So, please attempt to restore the 2022 backup and let me know if the results are different. If so, I'd say try to import the desktop data into the new backup and let me know. Thanks! |
It got quite far: successfully importing some 80000 messages or so including media. Then the app crashed. Are there any logs in particular I should try and grab for you? Also, is there any way to import the messages/contacts that were missing from the original android backup? I assume from the "skipped" warnings that those conversations would get dropped? |
No, not that I can think of, though I'm not an expert on these logs. But definitely all the exceptions, and maybe the ones from the initial crash are more important than the ones from restarting (though they may be the same). Still, I'd really like to hear that importing the original backup, without imported desktop messages, works correctly.
No, the contacts must exist in the backup, it is not possible to create valid contacts from the desktop data (that I know of). If no thread exists with some contact one is created, that is no problem. For exporting to HTML there is the Where possible, the way to get around this is again, to import the original backup into signal, get it updated and get as many of your contacts in there as you can, then export a new backup and try again. |
I did the merge again with
|
Looks like this could be the same as signalapp/Signal-Android#13034 ? |
OK, interesting, I will take a closer look later, I'm at work right now.
Yes it does very much look like #13034. It is important to note those other people appear to have used this program to verify the backup integrity and/or attempt a fix, not that this program introduced the problem. I your case, that's still to be determined, so one last time: you have to attempt to restore the original backup. Only if you do that, can we be sure you are running into a signal bug, and it is not this tool that is injecting bad data into the backup file. If the bug turns out to be in Signal, I will still try to find out what's causing it and see if I can alter the backups so that Signals migration doesn't choke on it (if I can), but we need to know whose bug this is. |
I attempted to restore from the original backup and got a similar crash.
What else can I provide to help? |
Excellent!
Well, I looked at the code where Signal crashes, but don't see anything incorrect about it. I've tried running it on my databases manually and that seems to work fine (though it's artificial data, as I didn't have any doubles in my database (this specific migration deals with duplicate messages)). I've begun re-implementing the migration functions from Signal, I hope that that will either work (successfully migrate) or allow for better error reporting. It's a fairly big job, so it'll take a while (if I can get it done at all). When it's done, I'm going to ask you to run the tool with some specific options on your backup and let me know the results if that's ok. Then I'll probably make some changes and ask again, repeatedly, until we figure out what or we give up. |
So I've implemented the migrations I linked to in my previous post, from v132 up to v191. Luckily most were very easy, just adding or renaming a single column in one of the database tables. Others were more difficult. It is very possible I've made some mistake in there, from a simple copy-paste error to actually misinterpreting what the intention was. Also, there was at least 1 situation were I needed to bail since the original version needed to talk to the server at that point. I don't know how big of chance at succeeding this has, but maybe it'll work, or maybe it'll give us a clue what's happening in Signal. You could run with:
And see if it works. If you see any errors during migrating, let me know. If everything looks good, (like this:
), you might attempt to restore the backup on a phone. Please do this on the original, unaltered backup, and do not attempt any other functions simultaneously on the same file (like importing from desktop or deleting attachments). I'm curious what's going to happen, let's see how far we get. |
I think that worked! Importing the migrated backup took me to the enter-a-phone number screen. I didn't enter my phone number as I wasn't sure if that would break a future migration/tell my contacts. I'm guessing I should merge in the desktop messages now and do the phone number step? |
Cool! I think the phone-number screen is normal after restoring a backup, it's been a while since I've done it. I would definitely finish setting up Signal, enter phone number and do the SMS verification, and make sure everything is working and all your data is there. Then export a new backup (it will be around version 240, not sure exactly), copy it from your phone to your computer and attempt to import the Signal Desktop messages into that new backup. |
That worked... sort of. Upon restoring this new backup; I did have (most of) my messages, but it did send a "has a new safety number" notification to all my contacts. In any case, I'm all set up on this new device now, so thank you! |
I ran a migration from an old signal backup from 2022 + a recent signal desktop database:
FWIW the database seems to be at 146:
I note that the merge was full of warnings, here are samples of each one:
Nevertheless, I attempted to import the output database into signal on my android phone.
The signal app crashed.
Looking via
adb logcat
I see:Hopefully that's enough for you to help out.
At least for the
view_once
warnings, perhaps it would help if there was a way to runmigrateDatabase
on the 2022 dump before merging it?The text was updated successfully, but these errors were encountered: