[Q] Viber crashes if using restored bkup data - Android Q&A, Help & Troubleshooting

Hey all.
I'm on a Samsung Galaxy S2 GT-i9100 running SlimSaber 4.4.2 20140531 (Kernel 3.0.80-SlimKernel+)
I backed up my APKs and Data with MyBackup Pro
Switched from NeatROM by flashing to Slim Saber
Restored all my data using MyBackup Pro
Mostly everything works except for Viber
A fresh installation of Viber works. But the moment I restore my data, it will not start up anymore. I've checked CatLog and the main error seems to be permission based:
Code:
Failed to chmod(/data/data/com.viber.voip/databases/viber_messages):
libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)
Unable to create files directory /data/data/com.viber.voip/files
I've tried manually changing the permissions to follow the same perms from the "fresh data" of Viber - but that doesn't seem to fix this error.
Full Viber log:
06-02 15:22:57.295 I/ViberApplication(11763): ViberApplication, initialization STARTED
06-02 15:22:58.145 W/FileUtils(11763): Failed to chmod(/data/data/com.viber.voip/app_optimized): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)
06-02 15:22:58.145 W/FileUtils(11763): Failed to chmod(/data/data/com.viber.voip/app_working): libcore.io.ErrnoException: chmod failed: ENOENT (No such file or directory)
06-02 15:22:58.150 W/ContextImpl(11763): Unable to create files directory /data/data/com.viber.voip/files
06-02 15:22:58.155 W/ContextImpl(11763): Unable to create files directory /data/data/com.viber.voip/files
06-02 15:22:58.165 I/ActivityManager(2256): Process com.viber.voip:remote (pid 11763) has died.
06-02 15:23:33.815 I/ActivityManager(2256): Process com.viber.voip (pid 9564) has died.
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/com.viber.service.VoipConnectorService in 1000ms
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/.api.billing.InAppBillingService in 11000ms
06-02 15:23:33.815 W/ActivityManager(2256): Scheduling restart of crashed service com.viber.voip/com.viber.service.contacts.authentication.AccountAuthenticatorService in 21000ms
06-02 15:23:34.865 I/ActivityManager(2256): Start proc com.viber.voip for service com.viber.voip/com.viber.service.VoipConnectorService: pid=11961 uid=10113 gids={50113, 3003, 1028, 1015, 1023, 3002, 3001}
06-02 15:23:36.350 W/FileUtils(11961): Failed to chmod(/data/data/com.viber.voip/databases/viber_data): libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)
06-02 15:23:36.355 W/FileUtils(11961): Failed to chmod(/data/data/com.viber.voip/databases/viber_messages): libcore.io.ErrnoException: chmod failed: EPERM (Operation not permitted)
I'm no Android developer but I am comfortable enough with basic Linux.. any help you can extend is appreciated!
Rgds,
Kristy

Fixed! Android Viber Backup and Restore Successful
Okay, thank Jesus I managed to get this fixed and this is what it took.
This solution required a Rooted device.
Restore Viber backup (for me I did this using MyBackup Pro)
Install SQLite Debugger from the Play Store
Using SQLite, try locating the Viber database files by selecting App then choosing Viber from the list (if you want to locate the database manually, for me it was under /data/data/com.viber.voip/databases)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
Save the backup somewhere on your SD card (not inside the viber folder or else it will get deleted)
Repeat the same steps for the "viber_messages" database
Uninstall Viber (or if you are using MyBackup Pro, go under Toolbox and "Wipe the Cache & Data" for Viber)
Reinstall Viber so that a fresh, clean working set of databases are generated by the app (or re-open Viber)
Do the usual setup of entering your phone number, letting it sync contacts etc
Once Viber has settled down, close it
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
Kill Viber if requested and wait for the restoration
Rinse and repeat for the "viber_messages" database
Once it is all done, reboot your device and hopefully, the next time you open Viber, the old messages & calls are all there! Unfortunately for me, presumably due to the change in ROMs, the photos sent in Viber messages are in my Gallery but NOT in Viber itself.. I suspect this can be fixed if the path is saved somewhere in the messages database - but right now, I'm just glad to have the text back.
If you get repeated errors from Viber during this process, try freezing the app using MyBackup Pro Toolbox (I believe Titanium Backup also has this option)
====
If this helped you, please click the THANKS

IT WORKED. THANK YOU VERY MUCH...
I've read so many guides around and they all resulted in either viber crashing or deleting messages right after connecting.
I had really lost hope of ever getting my messages back.

You are most welcome!
You are most welcome! I I'm a web developer and having to figure this one out gave me some insight into phone app development. Glad it helped someone
7amdoun said:
IT WORKED. THANK YOU VERY MUCH...
I've read so many guides around and they all resulted in either viber crashing or deleting messages right after connecting.
I had really lost hope of ever getting my messages back.
Click to expand...
Click to collapse

NICE!!!
You Legend! Your and only your process works!
Thank you!
BTW you don't know the location in the Android file system where all the photo's that have been sent and received is located do you? I need to restore my images but not sure where they are saved....(all good found the saved location /storage/sdcard0/viber/media...)
kmmc said:
Okay, thank Jesus I managed to get this fixed and this is what it took.
This solution required a Rooted device.
Restore Viber backup (for me I did this using MyBackup Pro)
Install SQLite Debugger from the Play Store
Using SQLite, try locating the Viber database files by selecting App then choosing Viber from the list (if you want to locate the database manually, for me it was under /data/data/com.viber.voip/databases)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
Save the backup somewhere on your SD card (not inside the viber folder or else it will get deleted)
Repeat the same steps for the "viber_messages" database
Uninstall Viber (or if you are using MyBackup Pro, go under Toolbox and "Wipe the Cache & Data" for Viber)
Reinstall Viber so that a fresh, clean working set of databases are generated by the app (or re-open Viber)
Do the usual setup of entering your phone number, letting it sync contacts etc
Once Viber has settled down, close it
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
Kill Viber if requested and wait for the restoration
Rinse and repeat for the "viber_messages" database
Once it is all done, reboot your device and hopefully, the next time you open Viber, the old messages & calls are all there! Unfortunately for me, presumably due to the change in ROMs, the photos sent in Viber messages are in my Gallery but NOT in Viber itself.. I suspect this can be fixed if the path is saved somewhere in the messages database - but right now, I'm just glad to have the text back.
If you get repeated errors from Viber during this process, try freezing the app using MyBackup Pro Toolbox (I believe Titanium Backup also has this option)
====
If this helped you, please click the THANKS
Click to expand...
Click to collapse

You are most welcome! Glad it worked out for you too!
blocka said:
You Legend! Your and only your process works!
Thank you!
BTW you don't know the location in the Android file system where all the photo's that have been sent and received is located do you? I need to restore my images but not sure where they are saved....(all good found the saved location /storage/sdcard0/viber/media...)
Click to expand...
Click to collapse

hello, while yes this way was VERY easy to do thank you so much for that!, the main problem im having is that i was searching for ways to bring back "voice messages" and this appeared to work it even shows that they are back but when i try to listen to *any of them i get this popup saying "you have chosen to delete this voice message" which i never did, any clue how to get voice messages back or how to rip and or convert from a TB file or from the restored folder on device?

Hey thatexan
This video may help in finding the files in the first place: https://www.youtube.com/watch?v=GVdjj1DRwMA
But unfortunately I have no ideas on how to get them to play. I haven't personally tried but if those really are the files, it is most likely that your voice messages are still in your backups but the location to them has not been updated in the Viber... and thus Viber thinks they have been deleted. I never tried fixing the photos issue so I don't have the steps that might help with your voice messages. Some suggestions though:
1) It is possible that in the viber database, it states where to find the photos/voice recordings. If you can find out where then you will need to update the location to point to the correct place
2) OR try receiving a new voice message in Viber and find out where it is stored.. then try putting your old voice recordings there.
3) If just placing your files there isn't enough, try poking around SQL lite to see if you can see the latest voice recording entry in the database and use that as a clue as to what to do - maybe the database needs to be updated with the new location for the old files?
I hope these suggestions help you find the solution. Do reply & share if you find a way to fix it.
thatexan said:
hello, while yes this way was VERY easy to do thank you so much for that!, the main problem im having is that i was searching for ways to bring back "voice messages" and this appeared to work it even shows that they are back but when i try to listen to *any of them i get this popup saying "you have chosen to delete this voice message" which i never did, any clue how to get voice messages back or how to rip and or convert from a TB file or from the restored folder on device?
Click to expand...
Click to collapse

THX a lot !!! tryed so much and your way works
but don't need SQlite - just make a backup (i used TITANIUM), put it on your PC, open it, search for these two files, copy them
copy /sdcard/viber/ media
and replace them with an explorer (i used ES)
reboot - done :good:
btw - any idea how to integrate files from desktop-version missing on phone ???

Glad it worked Sorry I have no ideas on the integration with the desktop-version though.

kmmc said:
Okay, thank Jesus I managed to get this fixed and this is what it took.
This solution required a Rooted device.
Restore Viber backup (for me I did this using MyBackup Pro)
Install SQLite Debugger from the Play Store
Using SQLite, try locating the Viber database files by selecting App then choosing Viber from the list (if you want to locate the database manually, for me it was under /data/data/com.viber.voip/databases)
Choose the "viber_data" database
Open the database, scroll to the bottom, choose "Create backup"
Save the backup somewhere on your SD card (not inside the viber folder or else it will get deleted)
Repeat the same steps for the "viber_messages" database
Uninstall Viber (or if you are using MyBackup Pro, go under Toolbox and "Wipe the Cache & Data" for Viber)
Reinstall Viber so that a fresh, clean working set of databases are generated by the app (or re-open Viber)
Do the usual setup of entering your phone number, letting it sync contacts etc
Once Viber has settled down, close it
Re-open SQLite Debugger
Navigate back to the "viber_data" database
This time, choose Restore Backup
Select the backup file from your SD card
Kill Viber if requested and wait for the restoration
Rinse and repeat for the "viber_messages" database
Once it is all done, reboot your device and hopefully, the next time you open Viber, the old messages & calls are all there! Unfortunately for me, presumably due to the change in ROMs, the photos sent in Viber messages are in my Gallery but NOT in Viber itself.. I suspect this can be fixed if the path is saved somewhere in the messages database - but right now, I'm just glad to have the text back.
If you get repeated errors from Viber during this process, try freezing the app using MyBackup Pro Toolbox (I believe Titanium Backup also has this option)
====
If this helped you, please click the THANKS
Click to expand...
Click to collapse
U are a genius .. titanium somehow deleted my backup (I am sure it was my fault, although I'm still not sure if I did anything out of the way) and so I tried all kinds of apps and recovery tools (android and windows) to no avail, finally reached Ur helpful post ... sheer brilliance is what U offer .. and a life saver ... I can't thank U enough .. do take Ur knowledge seriously, I scoured the internet, and no one offers what U do and that means a lot, out of the whole world, U are the only one with such an amazing workaround. Beautifully Brilliant ... :good:

Wow, thanks for all the kind words Anubis. It's only the mercy of Jesus that the solution works and still works.. I've got a programming & linux background and it helped give an idea as to what might be causing the issue Really glad it's continuing to help others!
Have a great day,
Kristy

Great guide, kmmc !!! I worked like a charm Thank you!

Hi Kmmc and all....!!
I am in same situation as yours..!!
I have moved to new smartphone and above situation has arised for me to move viber from old smart phone to new smart phone..
Just to reconfirm I have to have follow the backup process through same steps as suggested by you .
can i take backup on google drive through email so that i dont need to play around with sd card switch between old and new phone..
instead through gdrive i can download directly in new phone.. ?
next step would be to install viber on new phone and copy the vober_data and viber_messages file in the given path as suggested by you.
is that the right approach and understanding I am stating correctly ?
will appreciate your revert as well other members benefited by your solution..
To reiterate , your is the soimplest solution / approach compared to what all I have been exploring since last 4 days..no concerete solutions and mostly text backup or paid softwares. you are gem of a person
leo..!

cla1966 said:
THX a lot !!! tryed so much and your way works
but don't need SQlite - just make a backup (i used TITANIUM), put it on your PC, open it, search for these two files, copy them
copy /sdcard/viber/ media
and replace them with an explorer (i used ES)
reboot - done :good:
btw - any idea how to integrate files from desktop-version missing on phone ???
Click to expand...
Click to collapse
Thanks to @cla1966 and @kmmc for their instructions here, worked a treat.

Dear,
I got the same problem and follow your instruction step by step but it didn't work to me
I locate the 2 file (viber_data and viber_messages) in Titaniumbackup folder and restore to viber/media then restart but all the messages still didn't appear
I wish I know what's wrong
My phone is Xperia Z5

Szeretnék segítséget kérni. Sony xperia tipon viber üzenetek visszahozása lehetségeS?

Related

[GUIDE] SIM Card Locks randomly - Howto solve. (rooted SE X10i/a phones only)

You might be reading this because you experienced the things I've experienced on three different X10i devices so far:
After rooting the phone according to instructions found here on XDA-Developers, the phones started to lock the SIM-card, to what it seems, on a random basis over and over.
Sometimes it can go days before it suddenly locks up, other times just minutes between the locking intervals.
There is a solution.
Some of you might already have solved this problem, unintentionally.
There was a post further down on the "X10 rooting guide" suggesting what apps to remove. One of the apps suggested there, are the cause of the this problem, and once removed it also removed the problem.
Remember: If you don't have problems, you don't need to fix it either. -"Don't fix what isn't broken."
Before you read on, keep in mind you are having root-access and can cause some "serious" damage to the system files if you execute the wrong commands.
I hereby declines any responsibility if you choose to follow this guide.
You execute the commands at your own risk.
I assume you got everything already set up for adb access. If not, read on: http://forum.xda-developers.com/showthread.php?t=532719
The problem:
The Android OS uses parts of the SIMtoolkit (STK) to access the simcard in the phone.
Only one application/tool can connect to the simcard at a time, so any other application that needs access to the information on the SIM-card should to go through the STK.
However, there are a few "badly" written applications that doesn't go through the proper "channels" to access the SIM-card. They're often written to access the SIM-card directly. This causes a conflict, where STK is "smart" enough to move aside.
Every time an application or a tool connects to the SIM-card, the SIM-card resets and locks down again, requiring one to enter the PIN-code once again.
In the X10i's case, the "conflicting" application are Sony Ericsson's own "Backup and Restore" application.
The Android OS launches applications in a "prefetch" manner so they are available quickly once needed.
This causes "Backup and Restore" to get in between and "steal" the SIM-card connection every single time it's loaded, either by you, or by the Android OS itself.
This causes the SIM-card to reset and lock down every time the Android OS decides to unload "Backup and Restore" to free up memory.
Sony Ericssons developers should make the "Backup and Restore" app to go through Androids proper ways to access the SIM-card: via STK (SIMcard ToolKit) and not directly.
The solution: (Phone will reboot, save all data before proceeding)
Move/remove Sony Ericsson's application named "Backup and Restore".
There are better applications for backup available out there anyway, such as "Titanium Backup".
EDIT: As a user mentioned, further down among the posts here, it is possible to remove "Backup and Restore" with Titanium Backup. Just install Titanium Backup from the Android market, and then remove it from there:
1: Start Titanium Backup, accept root access.
2: Tap "Backup/Restore" at the top.
3: Scroll down and tap "Backup and Restore" in the list that appears.
4: Tap "Un-Install !"
5: Reboot the phone to clean out eventually remains of it in the phones memory. (Not necessary tho)
If the solution above isn't possible for some reason, follow these instructions: (Only if solution above fails)
The apk file is named: "semc-backup-rachael.apk". It's found in /system/app/
To move it out of harms way, execute the following commands in an adb-shell:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mkdir /system/app/temp1
mv /system/app/semc-backup-rachael.apk /system/app/temp1/
reboot
Once the phone rebooted, the "Backup and Restore" app should be no more, and therefor less random SIM-card lockups. (You still have to unlock the SIM-card after reboot, doooh)
If everything seems to be working in order after the reboot, and the "Backup and Restore" application are gone, Proceed to "CleanUp" further down.
If things do fail, execute the following to restore it to the previous state:
Do not execute this unless you want to restore the previous state:
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mv /system/app/temp1/* /system/app/
reboot
The CleanUp:
To remove any leftovers after a successful reboot: (WARNING: Unless you have an external backup of the semc-backup-rachael.apk file, this will be irreversible )
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
rm /system/app/temp1/*
rmdir /system/app/temp1
reboot
********In the X10i's case, the "conflicting" application is Sony Ericsson's own "Backup and Restore" application.*********8
If that was the case, I would have faced the same problem......But I am not....
Mine wasn't rooted until yesterday, but the same problem occurred to me few times on soft *20. After updating to *26 and using the Universalandroot app, everything seems to be fine.
it is the problem ..
I had same issue too, .. after removing backup and restore its gone
before i tried if it works and it worked for me like hell
install some task killer app (advanced task killer (ADK) from market for example)
turn on backup and restore (use middle button to go to the mainscreen)
run ADK and kill everything.
Maybe it will not shows on first try . Because you never know if the Bac and Res is currently accesing the sim card or not. But after few tries it will disconnect your sim and ask you for PIN.
off course you do not have the issue if you are not using some task killer app.
Backup and restore was causing this too for me, I figured it out last night LOL
Wish I had read it here first and saved myself loads of time.
Isn't it possible by just removing the "backup and restore.apk" with Titanium, i"m just a noob in this kind of things (rooted my x10i about 1 hour ago and already had the sim lock fault)
That's how I did it. Froze it first just to be sure.
Sent from my X10i using Tapatalk
ok.. since we are on sim card topic.. my problem is similar to this, i posted it here twice on forum but wasnt able to get any answer.. so problem is everytime i go out of reception i.e. basement, subway etc. so when i come back to reception(signal) area phone wont connect automatically, i hv to do it manually everytime.. even then it will show msg- your sim card does not allow connection to network. till date problem is not solved but i hv to go to STK and toggle SELECT VISITED NETWORK and RESELECT VISITED NETWORK. and set it on SELECT... then again doing manual searching will connect the phone...( i got this trick? on a local network provider forum, it works! but still lot of work each time..lol..)
i have rooted x10i with 26.. i have TB free version..
do u guys think above solution of removing SE backup n restore would repair the problem.. im just planning to remove it using TB.. plz put ur thoughts thanx
thank you it help me alot
Sent from my X10i using XDA App
Nice catch this was pissing me off for some time now.
I was killing tasks with ATK (using ATK widget) and afer cold boot first killing woud lock the SIM and I had no idea why.
Now I loaded backup and restore and killed tasks with ATK and sim was locked instantly. So SE backup & restore is gone.
Thanks and greetings KRadovan
I also removed the backup app with Titanium. No problems anymore. Thanks for the help on this one.
Sent from my X10i using XDA App
Thank for solving my problem, the backup and restore function was causing the problem here too.
Okay and now, I just downloaded tatanium and it says, no root access. Is there another way to remove backup and restore. My phone is not routed.
Chicane301 said:
Okay and now, I just downloaded tatanium and it says, no root access. Is there another way to remove backup and restore. My phone is not routed.
Click to expand...
Click to collapse
No there is not. Just root your phone with http://forum.xda-developers.com/showthread.php?t=740240
and then remove it.
Oke thanks, working on it. I'm not sure if I should root my phone, but it doesn't leave me a choice right now.
Done and backup and restore is removed. Thanks for the info and help everyeone!!
Still problems?
Hi
I've been having the same problems for the last couple of days on my X10 Mini Pro. It's rooted, I've removed Backup & Restore (and some other apps like stupid pre-installed demo(!) games) but it didn't solve it for me.
To find what causes this I've written a small app. It checks the sim-state periodically. If it's in some way unavailable or a pin-code is required to unlock it, it warns you by vibrating plus default notification sound.
If you're quick you can try and debug the event(s) with an app like aLogCat.
At least you'll get notified of not being reachable.
Thought i'd share it (see attached .apk)
Since I have no Market Account you have to upload it to your phone manually. Use ADB/Dos-prompt or MyPhoneExplorer.
-----------

'Google Talk authentication failed' error

I just got my Atrix yesterday, I seem to have the issue where it wont successfully log in to google talk which also means that I cant download apps. I've tried making a new account which also failed to work. Are there any ideas out there for how I could fix it?
Can anybody help me?
I had the same problem and figured out that it was Droid Wall keeping Gtalk from connecting. Make sure Talk can access the network freely.
Sent from my Nexus S using XDA Premium App
Real solution
Gibsonflyingv said:
I just got my Atrix yesterday, I seem to have the issue where it wont successfully log in to google talk which also means that I cant download apps. I've tried making a new account which also failed to work. Are there any ideas out there for how I could fix it?
Click to expand...
Click to collapse
After cloning a samsung gio s5660 through a CWM backup I started experiencing the same issue. Heres What REALLY happens.
Google authenticates you in their services trought unique "keys" which are automatically generated upon system installation / factory reset, so if you clone your device or install a rom which has these "keys" pre-installed, obviously, your rom will only autheticate you in google servers if your phone is the only one using the service at that given time... Upon failure, your phone assumes to be the one who's wrong, and google servers won't autheticate you until you either tell your phone he is not wrong (by deleting the data from play store, which resets its status and errors) or you change the "keys". SO, what can we learn from this? deleting the play store data IS a temporary solution, and won't solve a thing. Let's delete the duplicated keys shall we?
Navigate with your favourite folder explorer on your android (I use X-plore, you can tell me anything, there's nothing better) to the following directory:
- "(root)/data/data/com.google.android.gsf"
Now you have two real options, either you may delete the all folder, which was the perfect solution for me, since my rom is prepared to re-create it upon phone restart and new keys will be generated, OR, you might want to just delete the contents of app_sslcache inside com.google.android.gsf whish are THE KEYS I HAVE BEEN TALKING ABOUT THIS ALL TIME, YEEEIHHHH and reboot your phone...
Needless to say, take a nandroid backup before you do any of this...
Thank me later
For those who remember me from symbian s60v3 phones, yes, it is me, I'm back, and I've moved to the droid world, it's much better indeed
Let me just say, I have no idea why this thread was moved or resurrected. Whoever did so was about a year and a half too late. Please close/delete this thread.

Problems when restoring mmssms.db in nougat

Greetings.
I'm having a problem restoring my messages using adb method in Nougat. I have done it before in CM12 and CM13 with no problems but since I flashed LineageOS 7.1.1, I had problems with it. First was the location. Before it was located in /data/data/com.android.providers.telephony/database. After googling around, I found a this thread. Turns out it was now located in /data/user_de/0/com.android.providers.telephony. So I go ahead and pushed my mmssms.db backup to that location but still my messages did not appear. Worse is my SMS app crashes every time I open it. Did a reboot, wiped cache/dalvik cache, tried to delete the *.db-journal files as mentioned in the thread but still no luck. I had to wipe the data again to regain my SMS app. I hope someone can help me. TIA
Bump
I have the same problem...
Yep same problem here. The /data/user_de location doesn't really seem to work either
Same problem here with latest Lineage on a rooted serranoltexx (Samsung Galaxy S4 mini LTE). I think something changed in the last update, but I don't understand whether it's Android's or Lineage's fault.
I give you more information, as it seems like a recent issue which troubles a lot of users - I found many similar threads, but no solution so far.
On my old Samsung S2 I was using the app SlightBackup (free, from F-Droid) to backup SMSs. However, copying the SlightBackup database (.xml format) on my new phone and reinstalling it there doesn't seem to work, so I decided to copy manually the mmssms.db file. Also in my case, the new directory seems to be /data/user_de/0/com.android.providers.telephony/databases (however, there is also a file called telephony.db which has a symbolic link in /data/data/com.android.providers.telephony/databases )
Still, my SMSs do not show up, and moreover the "contacts" app crashes. I tried deleting all the content of the folder and then the messaging app crashes (a full reboot restored the content, however, and the functionality of both apps with it).
Interesting to notice that all the *.db and *.db-journal files in the folder do not change size even if I send/receive SMSs, so I guess they are there just for compatibility, and do not actually store the messages. The "real" database is probably somewhere else, but I have no idea where to look for.
Help would be really appreciated. I'm willing to send 0.01 BTC to the first person who finds a working solution
P.S.: yes, I have also taken care of the filesystem permissions of the .db file, which is something not mentioned in any other thread I found, but important I think. In my case the .db file is 660 with owner radio:radio, same for the .db-journal but permissions 600.
P.P.S.: installing third-party apps to restore my SMSs is not an option in my case. I know about working apps in the Play Store but I don't want to use them.
P.P.P.S.: yes, my phone is rooted, and I am not using third-party messaging apps, just the default one.

Failed to Restore Whatsapp Database after migrating from STOCK to LineageOS 14.1

I'm struggling with something that never happened to me, I'm unable to restore my database to my recently upgraded Samsung J3 2016 - is running LineageOS 14.1 now
The phone was running stock Android 5.1.1, version J320FXXU0AQI1, nothing fancy here.
Made some research about what ROM to use and decided to upgrade to LineageOS 14.1, I'm really sick and tired of Google spying my steps, my contacts and the number of times i take a piss every day, and so on. Right now I don't have any Google account associated with the mobile (could this be the problem, since this is a custom ROM?)
Everything ran smoothly, backed up my contacts, call logs, SMS, pictures and the ENTIRE Whataspp folder. This method always worked fine on several phones I've upgraded or simple swapped equipment to a more up-to-date hardware. Everytime worked like a charm, restored logs, contacts and so on, in what it concerns to Whatsapp i simply moved the ENTIRE folder to the new phone (or upgraded phone), installed the Whatsapp app and is just straight forward for the app to ask me for a SMS code to activate the software and then asked me to restore my backed up database. It has been very simple so far, but not this time:
When it reachs the point to detect and restore my database Whatsapp states that can find one Database from 1970 (???? WTF) with 0 bytes, and after that it fails to restore my data (not strange, 0 bytes is no data). I've already tried earlier versions of Whataspp, tried different databases (there are 7 in my folder, i don't believe all of them are corrupted). I'm reaching 0 ways to explore. BTW, i dont use Google drive to store my backups because its enough for Google to know how many times i take a piss everyday, i rather have the backups with me, on my phone (thanks any way Google), but the files are safe in my desktop and on my phone for now, inaccessible so far but their're there.
Can any one point me some way to try to revive my database? Just a note, i have an older phone that still have Whatsapp there, i didn't erased it, maybe it's there something of interest for this situation?
Thanks so much in advance for everyone that can help, any hint can be helpful.
Update!
I've managed to get another phone, exactly the same, Samsung J3 201 J320F.
I've sent my whatsapp folder to the phone, signed in to my google account, installed whatasapp and, like 98% of the times my backup is ok and is restored. Now I have two phones:
1- one with Whataspp working fine (the one with Stock ROM 5.1.1 J320FXXU0AQI1
2- another one, the main phone, where i want to put my whataspp backup working but it simply doesnt work (previous post). Everything elese is settled and working just fine. Maybe whatasapp doesnt like Custom ROMs??
So, I'm sure that my backups are fine, right now I have access to anything that i may need i guess. I don't believe that Im the first person not beeing able to restore whataspp backups in LineageOS.
Please help
New developments.: I've installed Ressurection 5.8.5, the latest available for this phone. It runs ok, but Whataspp problem is still there, the backup is marked to have 0Kb, somehow Whataspp simple doesn't want to recover my backup if I'm using a custom firmware (I receive a warning about no support from them if I have problems at the beginning of the startup process).
So far this method didn't work (Whatsapp shows my Backup with 0Kb):
1) Copy your latest crypt 12 file to /sdcard/WhatsApp/Databases/
2) Install / Activate WhatsApp
3) WhatsApp will retrieve the key from their server and restore your backup.
I've tried this method that appeared to have some success in same cases. Followed everything but no luck, Whataspp detects a 0Kb backup also.
Meanwhile I still don't believe that I'm the very 1st person that this happens, I'm still very impressed with this. If the OP thinks I'm in the wrong Topic please feel free to move it to the right place, maybe there I'll have better luck.
Not that I have much knowledge in that direction, but the issue sounds more like it is about the file than Whatsapp itself. Maybe some permission issue? If you use a filemanager app like total commander, can it read the file fully? I found a topic that had 0 byte filesize issue and a simple reboot apparently fixed it.
musschrott said:
Not that I have much knowledge in that direction, but the issue sounds more like it is about the file than Whatsapp itself. Maybe some permission issue? If you use a filemanager app like total commander, can it read the file fully? I found a topic that had 0 byte filesize issue and a simple reboot apparently fixed it.
Click to expand...
Click to collapse
Hello musschrott, and thanks for replying.
I've tried moving the database file, erase it, changing it's name and the android system allows me to do it, i think the file itself is free to be read by Whataspp, but your other tip, the permissions in system made me google around (even more..) about it and I found here on XDA this. : "The privacy protection in the drop down menu and the permission in the app settings." (credits to LegoTechniker). On the privacy protection is all ON but in the Permission is all OFF and Whataspp nor the System ask me to turn it ON and it can result on whatasapp reading files with 0Kb from 1970.
I'll give a try but only tomorrow because the code/phonecall from Whataspp have a 48h delay and keeps increasing everytime I try a different method to solve this issue.
musschrott, thanks again!
tomalamix said:
Hello musschrott, and thanks for replying.
I've tried moving the database file, erase it, changing it's name and the android system allows me to do it, i think the file itself is free to be read by Whataspp, but your other tip, the permissions in system made me google around (even more..) about it and I found here on XDA this. : "The privacy protection in the drop down menu and the permission in the app settings." (credits to LegoTechniker). On the privacy protection is all ON but in the Permission is all OFF and Whataspp nor the System ask me to turn it ON and it can result on whatasapp reading files with 0Kb from 1970.
I'll give a try but only tomorrow because the code/phonecall from Whataspp have a 48h delay and keeps increasing everytime I try a different method to solve this issue.
musschrott, thanks again!
Click to expand...
Click to collapse
For everyone and specially those who helped (musschrott).
This has worked for me: giving full permissions to Whataspp in "Settings - Privacy" and in "Settings - Applications" worked like a charm, you have to do it BEFORE you start Whatsapp.
Best regards to everyone and thanks once more!
Make sure the WhatsApp backup file is in internal storage, and rename the backup file to msgstore.db.crypt.
After upgrading to LineageOS 14.1,install WhatsApp.When asked to restore from backup,choose the "msgstore.db.crypt" file.
mango9 said:
Make sure the WhatsApp backup file is in internal storage, and rename the backup file to msgstore.db.crypt.
After upgrading to LineageOS 14.1,install WhatsApp.When asked to restore from backup,choose the "msgstore.db.crypt" file.
Click to expand...
Click to collapse
Yes,
Those are the basic steps, but BEFORE running Whatasapp for the 1st time you have to give permissions in the system to Whatsapp because these are all OFF and the system doesn't ask to turn them ON when the permission is needed, simply presents you a file with 0Kb from 1970 and that's it. Again, you have to do this BEFORE the 1st Whatsapp startup and everything should run well.
Best regards
My issue is I gave full write permissions but then it goes straight to the Google Drive restore and does not show my local backup.
When I followed this by Rahil:
https://www.reddit.com/r/whatsapp/comments/np2zjp
"So today I finally fixed the issue myself
Click to expand...
Click to collapse
Steps: 1)make sure you rename the database as it should be.
2)Install whatsapp
3)Insert your number when asked
4)Use Otp/code
5)Then the app will ask you for google drive permission ,click allow/ok
6)Then the app will ask for contact permission ,simply deny this permission (very important)
7)Then the app will ask for storage permission ,hit allow (very important)
8)Then you will see your local storage behind the popup saying allow google drive and crap You will need to press add account and have your fingers ready for instant tapping between add account and instant tapping restore button ,and out of 10-30 times doing this practice, you will luckily hit restore button, I know this sounds confusing, And I can make a tutorial video if you want ,this works 100%
9)once it is restored ,you will still see app asking google drive option, don't click skip (this will reset the app ,leading to nothing restored) , So when the app is asking to restore from google drive, close the app right away (very important)
10)open the app ,and the app will ask you to set name ,set your name ,and you'll see all your backup"
Click to expand...
Click to collapse
It works but then it shows my local backup as 0k and from 12/31/1969
This is Driving me wild and now I have to wait 12 hrs to try again. Has anyone solved this ridiculous error?
dpoverlord said:
My issue is I gave full write permissions but then it goes straight to the Google Drive restore and does not show my local backup.
When I followed this by Rahil:
https://www.reddit.com/r/whatsapp/comments/np2zjp
It works but then it shows my local backup as 0k and from 12/31/1969
This is Driving me wild and now I have to wait 12 hrs to try again. Has anyone solved this ridiculous error?
Click to expand...
Click to collapse
Did you find a solution to this? I have the exact same problem

WhatsApp Restore Stuck at 24% - Partially Working Workaround (June 2023)

Hey Guys,
Today suddenly my WhatsApp gave a message error, followed by a full deletion of the entire chat history. 10 Years of work (I run my business via WhatsApp).
I had my Google Drive backup, but everytime it hit 24% it got stuck and failed to restore the messages. None of the proposed solutions I could find online fixed it for me, nor did the poor WhatsApp support which is practically a machine prompting same non-working solutions.
After reading many different solutions and threads about it, I started to feel and think that possibly the cause of it is some bug or failure to retrive media files, and looks like I was right - I just made a breakthrough that at least allowed me to restore all the chats, without the media - but hell, at this stage I'll take what I get. And that's 10 years of it - I couldn't afford losing it.
So for all of you who are facing the same problem and are willing to waive media, those are roughly the steps I took which solved it for me (lots of other things in the way that I doubt helped):
I highly advice before you do it, maybe to avoid many of the steps I did and especially before uninstalling and reinstalling WhatsApp as the WA Support advices you to do, to go to Internal Storage > Android > Media > com.whatsapp > WhatsApp > Databases and copy the msgstore.db file. Also, try to create a local backup by disabling Google Backup and perhaps getting another updated version of the chats. I didn't do it, and I think it costed me a lot of extra steps to try to get the local backup file back, as well as some missing recent chats.
1. Uninstalled WhatsApp, rebooted the phone.
2. Authenticated and started normal backup restore from Google Drive process.
3. Connected the phone to my computer, so I can see real time via Windows Explorer which files are downloaded as a part of the backup (Storage > Android > Media > com.whatsapp > WhatsApp).
4. When download finished and the restoring process started, I immediately copied the Databases and Backup folders as they were brought from the Google backup, leaving the Media one out which I figured is the one causing the issues. Note it's important to do it as soon as download finishes and files are complete, as WhatsApp deletes it if backup fails.
5. When hitting the 24% stuck mark, I 'force stopped' WhatsApp, and uninstalled the app again, then restarted my phone.
6. I reinstalled WhatsApp, and didn't open it.
7. I went on to Create the folder Storage > Android > Media > com.whatsapp > WhatsApp > Databases, and pasted my msgstore.db file in it.
8. I opened WhatsApp, authenticated and started normal backup restore from Google Drive - and it worked. All my chat history is back.
9. I changed my Google Account for WhatsApp backup, and created a fresh backup just in case.
Now I'll decide if makes sense to also attempt recovering the media but at this moment I'm way too tired to think about it anymore.
Hope this helps you!

Categories

Resources