4

Question:

I was using Viber in both PC (not the windows 8 metro style app) and Mobile phone. Unfortunately I lost my phone. Still I can use the desktop version of Viber . I can see all my contacts there (Viber + non-Viber). I need to retrieve those contacts as .vcf or any other standard format which we use to store contacts.

Please let me know if there is a way.

What I have tried so far:

I opened files under "C:\Users[userName]\AppData\Roaming\ViberPC" using note pad and checked for contact information. But it did not succeed.

7

You can open viber.db in C:\Users\USERNAME\AppData\Roaming\ViberPC\YourNumber with WordPad and somewhere in the beginning of the file you will find contacts phone numbers. Just enter them manually in your new phone and they will appear on you contacts list in Viber.

Or download command-line shell for accessing and modifying SQLite databases and copy sqlite3.exe , viber.db and data.db to C:\. Then in CMD(start -> run -> cmd.exe) position yourself on C:\ and enter sqlite3.exe viber.db
Then enter:

 SELECT ContactRelation.Number, Contact.FirstName, Contact.SecondName FROM Contact INNER JOIN ContactRelation ON Contact.ContactID = ContactRelation.ContactID ORDER BY Contact.FirstName;

There you go! You got all contacts listed, phone number first and then the name!

| improve this answer | |
  • 1
    Have you tried my answer? @KushanRandima – Davidenko Feb 5 '15 at 8:45
  • I really want to try this, but still I couldn't find time for that. Because I was busy in past week and even on this week. I'm so interested in your answer. I will try it as soon possible and let you know the results. – Kushan Randima Feb 9 '15 at 4:49
  • 1
    Thanks a lot. It worked for me. If you need to get the results to a file (Ex: - CSV file), please refer this article. stackoverflow.com/questions/6076984/… – Kushan Randima Feb 23 '15 at 10:43
1

Maybe the data base structure has changed, in my case, I had to slightly change @Davidenko's instructions.

Install a SQLite command-line shell, perhaps from here sqlite.org/download.html. It is bundled in the sqlite-tools.
Copy the file

C:\Users\USERNAME\AppData\Roaming\ViberPC\YourNumber\viber.db

somewhere. Now in PowerShell or CMD cd to viber.db directory and open it with:

sqlite3 .\viber.db

That opens viber.db in the SQLite shell.
To export contacts as a CSV file, write in the SQL shell:

.mode csv
.output contacts.csv
SELECT Contact.Name, Contact.Number, Contact.ViberContact FROM Contact;
.output stdout

To export text messages as a CSV including related contacts, write:

.mode csv
.output messages.csv
SELECT Contact.Name, Contact.Number, Contact.ViberContact, Events.TimeStamp, Messages.Body  FROM Contact INNER JOIN Events ON Contact.ContactID = Events.ContactID INNER JOIN Messages ON Events.EventID = Messages.EventID  ORDER BY Contact.Name;
.output stdout
| improve this answer | |

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