I'm using Whatsapp from a virtual machine since I lost my phone, and now need to transfer it to a new VM.

The easy way would be to use the backup feature native to Whatsapp, but it is disabled since the VM is connected via Ethernet (and Android thinks it's a Mobile connection). In fact the very "local backup" feature is not available. I have a ton of messages which I really wouldn't like to lose.

There's an Xposed module which could possible fake an Wifi connection in the Android VM, but at this point I really want to do the entire transfer locally as my internet is painfully slow right now.

I tried the built-in adb backup feature, only to find out it's disabled for Whatsapp and can't be easily enabled (requires decompiling the apk file).

So, how can I manually transfer Whatspp app data to the new "device"? What folders do I need to copy, and what files must be modified in order for the transfer to work seamlessly?

I do of course have full root access.

[Update] Neither of the following work:

  • Copying the entire contents of /data/data/com.whatsapp/databases after installing Whatsapp, signing in and closing it. It will crash when opening, without any error message.

  • Copying the same directory, but without opening Whatsapp and signing in after installation. Same error as above.

  • Copying /data/data/com/whatsapp/databases/msgstore.db after installing Whatsapp and signing in. An error message is presented: "Something went wrong with your chat history"

  • Copying the entire /data/data/com.whatsapp directory, after installing and closing it. It will crash when opening, without any error message.

  • The concept would be to create a TAR archive of anything under /data/data/com.whatsapp (in order to preserve the permissions and ownerships). Then, you'll need to install WhatsApp on the new host machine, and lastly you should untar the previously created archive under the /data/data/com.whatsapp directory of the new machine, overwriting all of the files that'll be already there. This should emulate the backup operation performed by a dedicated app, but remembered that this is a mere concept I didn't test yet. – Death Mask Salesman Jul 6 '16 at 9:39
  • @DeathMaskSalesman I did try, unfortunately that doesn't seem to work. The app will crash when I try to open it. – Marc.2377 Jul 7 '16 at 2:53
  • Don't you have root? If you do, you could use some application like Titanium Backup. It's been a while since I last used Android, but copying apps, especially Whatsapp, will hardly work for apps such as Whatsapp, Facebook or Messenger. – Ezequiel Barbosa Nov 17 '17 at 23:04
up vote 1 down vote accepted

I was encountering the crashing behaviour trying these approaches too, but @DeathMaskSalesman seems to've been on the right track—the crashes are indeed a permissions issue.

If you remove WhatsApp entirely, reinstall it, and copy /data/data/com.whatsapp over and adjust the permissions correctly before launching it the first time, then it should just need to reverify your number to work. This worked for me.

To adjust permissions, first use ls -la to check the permissions on what's put in the /data/data/com.whatsapp directory upon install, e.g.:

drwxrwx--x   3 u0_a105 u0_a105  4096 2018-07-14 00:55 cache

Then use the username and group (here both u0_a105) to rename the files after you've copied them in:

chown -R u0_a105:u0_a105 /data/data/com.whatsapp/*

Then WhatsApp should launch okay without crashes, and retain settings, messages, and multimedia.

  • 1
    Thanks, I'll try this the next time. Makes sense and should work, I'm accepting this answer. – Marc.2377 Jul 14 at 22:46

If you have root, you can use TitaniumBackup to save Whatsapp data.

If you don't have root, you can downgrade to Whatsapp 2.11.431 (you can find it here) which was the latest version with adb backup feature activated, and then proceed backing up with adb (instructions).

You can find WhatsApp data in the directory /data/data/com.whatsapp, just copy all the contents of subdirectory databases with adb pull /data/data/com.whatsapp/databases and transfer it onto your new VM with adb push path/to/saved/databases/directory /data/data/com.whatsapp/databases, be sure the target it's empty.

  • Thank you for your answer. I'm guessing I must first install Whatsapp on the new VM, right? Or should I create the /com.whatsapp/databases manually as the first step? – Marc.2377 Jul 5 '16 at 23:17
  • Yes, you must install WhatsApp, then register your account as usual, that will create the com.whatsapp folder and its contents. – boxHiccup Jul 6 '16 at 13:56
  • Unfortunately it didn't work. I get the following message when attempting to open Whatsapp: "Something went wrong with your chat history". – Marc.2377 Jul 7 '16 at 2:54
  • There is any difference between WhatsApp versions in both VMs? – boxHiccup Jul 7 '16 at 6:09
  • No, it's the same version. – Marc.2377 Jul 7 '16 at 8:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.