12

Since Viber currently doesn't offer backup and restore functionality, I resorted to using Titanium Backup for transferring message history to a new phone.

However, after the restore, when launching viber, the message history appears for a second and then the activation screen pops up for confirming the new device -- and after the device is confirmed (via incoming call or sms), all the history vanishes!

Any ideas?

  • I don't use the app but I suspect you're able to see that confirmation because after restoring the app data the account wasn't restored explicitly. Accounts has to re restored separately in the device. – Firelord Sep 21 '15 at 7:48
  • What method did you use to transfer Viber messages to your new phone? I just switched from Galaxy S6 edge to S7 Edge so looking to transfer Viber chats to my new android. So far I tried these instructions about transferring Viber chats from old Android/iPhone to new Android/iPhone with some app: easyphonerecovery.com/… It worked and I could transfer 20 Viber messages with attachments to my S7 edge. Now, it’s asking me to pay $19 if I want to transfer all the chat history. Is there any free solution? Else I’ll buy this software. – Neal Sharma Jul 23 '16 at 11:49
13

You can do it without root access

Requirements:

Then do

sudo apt-get install openjdk-8-jre-headless
sudo apt-get install android-tools-adb android-tools-fastboot

Now, do the following

  1. Connect the old mobile, create backup with adb backup (disable WiFi and data and forget the old phone)

    sudo adb backup com.viber.voip -f /home/user/Downloads/viberoldphone1.ab
    sudo java -jar abe.jar unpack /home/user/Downloads/viberoldphone1.ab /home/user/Downloads/viberoldphone1.tar
    
  2. Install Viber on new phone and activate Viber, connect the new phone and create backup with adb backup

    sudo adb backup com.viber.voip -f /home/user/Downloads/vibernewphone2.ab
    sudo java -jar abe.jar unpack /home/user/Downloads/vibernewphone2.ab /home/user/a/vibernewphone2.tar
    
  3. Open TAR archives in an archive manager (found Archive manager for GNOME 3.14.2 on my Lubuntu LiveCD). Copy files below from viberoldphone1.tar DB directory to vibernewphone2.tar

    • viber_data
    • viber_data-journal
    • viber_messages
    • viber_messages-journal
  4. Repack to .ab and restore data to phone

    sudo java -jar abe.jar pack /home/user/a/vibernewphone2.tar /home/user/Downloads/vibernewok.ab
    sudo adb restore /home/user/Downloads/vibernewok.ab
    

Works like a charm. I have just tested on Android 4.1 and 5.0. I run into problems on Win7 with adb so finally used Lubuntu.

You can try to edit Viber DB files with SQLite editor. Probably DB files could be restored directly but I had no time to test

References:

  • 1
    The most easy and straightforward way. Without any root and permissions stuff. – user24730 Oct 5 '15 at 17:21
  • Works perfectly! I noticed a few extra files in the backup of my new Viber install which weren't in the backup of my old Viber (files like viber_data-shm and viber_data-wal). I just ignored these, followed the instructions as stated, and it worked fine. Why is every command prefixed with "sudo" though? I ran these without sudo, so long as you own the directory you're saving backups to it should work. – David Nov 5 '15 at 10:37
  • Links are always good for Extras info. – Rahul Bali Mar 21 '16 at 14:35
  • First of all thank you very much! These instructions didn't seem to work for me, after some testing and realizing the way the "tar" created the tar archive threw BackupManagerService off giving "java.io.IOException: Illegal semantic path" and other errors. To circumvent this I've followed the instructions at forum.xda-developers.com/showthread.php?t=2011811 to created the tar without trailing slashes and in the exact order of files (by listing the files from the new phone backup), using "pax" as the archiver. – Asaf Mar 27 '16 at 8:27
  • Works like a charm. Just don't forget to copy the /viber/media files from the old phone as well to get the missing photos/videos. Mine happened to be on the external storage so copying it was easy. – Organic Addict Apr 12 '16 at 2:00
5

Overview:

To completely migrate Viber, you will have to copy your message databases from old device and set them to Viber's own on new device. In addition, if you want to have all photos and videos from your conversations, you must migrate them too.

How to:

  1. You need both devices rooted
  2. On both devices install some Root File Manager (further "RFM"), like Total Commander or ES File Explorer.
  3. On the new device install Viber and activate your mobile number. You message board will be empty for now.
  4. Lets backup your user photos and videos:
    • On old device go to directory, where Viber user data files installed. In most cases it will be your Home directory, such a /storage/sdcard or /mnt/sdcard or /storage/Emulated/0, etc. In most cases it is in your Internal memory, but if someone chose to move Viber to SD card, then he/she have to go to /storage/extsd or/mount/sdcard2 or whatever it named in his/shes particular system.
    • In this directory Viber directory will exist (with "media" directory inside, just for proper identification). Directory Viber contains all downloaded user photos and all images and videos from your conversations. As many videos you send and receive, as big it will be. You will need to backup this directory.
    • If you have external SD slot, use it for copying mentioned directory to SD card. If you do not have such, use any other method allowed by chosen RFM - send it by FTP to your PC/new device, send it by e-mail to yourself, share it to Google Drive etc.
  5. Lets copy message databases from old to new device:
    • On the old device open RFM and go to /data/data/com.viber.voip/databases/. There you will find 6 files (in 3 corresponding pairs); you will need all of them, so copy them all to your external SD or so, as I mentioned before.
    • Well, we finished with old device. It's up to you now for not pollute our planet throwing it to the trash mindlessly and consumingly.
    • On new device go to the same directory and see the same files there. 3 of them (those without .journal extension) will have permissions rw-rw---- (or 660), and the rest 3 - rw------- (or 600). You may see permissions right after file name, or you must get file property - it depends on RFM. Remember those "permission map".
    • Choose any current file and get his Properties in chosen RFM. You will see UID/GID (Owner/User and Group ID) of it either in form of owner name (like Viber) or system name (like u0_a92) or user ID (like 1092). Remember this UID or write it down.
    • Now you can copy all 6 "old" files from SD (or whatever else place you copy them before) to current location (/data/data/com.viber.voip/databases/) on new device.
  6. Lets set proper rights to message databases:
    • Some of RFM (as Total Commander) allows to do group operations with permissions and UID/GID. Select all 6 files and get Properties of them. If your RFM allows you to set now Owner/Group or permissions, you lucky man; if not, you will must do next steps repeatedly for each single file.
    • Now you will need correct UID you remembered/written down before. If you thought you should easy remember u0_a92, but you don't, and now you are in doubts about correct UID, don't panic. Parent directory (/data/data/com.viber.voip/databases/) have the same correct UID, so cancel, go one level up and get it in it Properties.
    • For all 6 files in /data/data/com.viber.voip/databases directory get it properties and there set correct UID, which you remembered before (instead of current "root", set during copy by RFM). Probably you will be pushed by RFM to choose from a (long) list of existing UIDs, instead of writing down user ID manually.
    • For the same 6 files set the same correct GID as in previous step.
    • In file properties (for each fileset of 3 files) set correct permissions, as you remembered before (according to "permission map").
  7. Lets restore your photos and videos:
    • Go to the Viber installation directory on the new device (usually /storage/sdcard if there is internal memory) and copy there Viber directory, you backed up in Step 4.
  8. Go to Settings -> Applications -> Viber and Force Stop it.
  9. Start Viber and enjoy your migrated conversations, with photos and videos, as nothing never happens.

P.S. I really do not understand why Viber have no will to implement this easy procedure.

  • I tried following your instructions to the letter, but can't get this thing to work. I'm transferring from a 4.0.4 Xperia Ray (which doesn't seem to support adb backup option) to a 5.1 Cubot X17, both rooted. I tried copying all the six files or only four (as per above answer). I also tried setting file permissions (with ES) to what they were by default before overwriting and to what you stated in your replay, but all for naught. Once I restart viber it will simply show no messages and no groups. If I clear data, groups come back, but they are all empty. Any and all suggestions appreciated. – mkey Feb 5 '16 at 23:26
  • Oh dear, one of those facepalm moments. I tried opening these recovered databases in SQLite browser and it appears there are no messages in the corresponding database. Which makes me think that these messages may have been deleted when I used the export option. Or I cocked up something badly when copying. – mkey Feb 6 '16 at 13:10
1

None of the responses I have read on the web has worked for me. But the following very simple method works perfectly:

  1. On your target device, install and activate Viber
  2. Using a file explorer that allows access to the whole device (e.g. ES File Explorer), navigate to /data/data/com.viber.voip/databases on your source device, and copy the file viber_messages to the same location on your target device.

Note: I did this as follows:

  1. Started ES File Explorer's FTP server on my target device
  2. Using ES File Explorer on my source device, copied the desired file from my source device to my target device's download folder using FTP (I couldn't see /data/data/com.viber.voip/databases from the source device)
  3. Using ES File Explorer on my target device, copied the desired file from the download folder to /data/data/com.viber.voip/databases/
  4. Restarted Viber on the target device
  • 2
    You should point out that this requires both, source and target device, to be rooted. – Izzy Dec 29 '14 at 15:06
1

I also had many problems with this issue, but finally I managed to import Viber messages from other phone.

Steps:

  1. Use Titanium backup to backup Viber on old phone
  2. Restore Viber by Titanium Backup, but do not start it (no activation!)
  3. Make a save from Viber with Titanium Backup on new system (Backup/Restore page - Viber)
  4. Activate Viber (and loose all messages)
  5. Go back to Titanium Backup and Clear data of app (Viber)
  6. Make a restore data with prev. saved data
  7. Run Viber, and your messages are OK!
0

I recently upgraded from Galaxy S6 Edge to new Galaxy S7 Edge and like OP I didn't want to lose my old Viber conversations. I successfully transferred all the Viber messages along with the photos, videos, and other attachments from my old Android device (S6 edge) to new Android device (S7 edge) with the the help of a paid third-party software called Android Viber Transfer mentioned in this guide.

It costs $19 but I guess it’s the only tool to transfer Viber messages from one phone to another (Android to Android and iPhone to iPhone) because on Google I found 3-4 websites that are talking about this tool. Free version lets you transfer only 20 messages which is kind of useless. These are the steps that need to be followed in order to transfer Viber messages from one Android device to another:

  • Launch the app on your computer and connect your old Android device with to your computer via USB cable. Make sure USB debugging is enabled on your device.

  • Tap ‘Back up my data’ on your Android and you’ll be able to see all
    your Viber chat history on the UI of this program.

  • Right click on your Android and choose “Backup Messages” to
    backup your Viber messages to the local database on your computer.

  • Move the SIM card to your new Android device, download the Viber app on your device and verify your phone number.

  • Finally, connect your new Android device to your computer, right
    click on the database that you’ve created and choose “Restore
    Messages”.

I tried this on my non-rooted S7 edge running Android 6.0.1 Marshmallow and it worked for me. I hope my answer will help the folks those who are looking to transfer Viber messages from their old device to new device as currently there isn’t native/official solution for this.

  • Unfortunately, this doesn't work anymore on Android 7 and above. – TJJ Apr 23 '18 at 11:05

protected by Community Oct 2 '15 at 14:21

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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