Retrieve/Export contacts from Viber PC version

41,383

Solution 1

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!

Solution 2

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
Share:
41,383

Related videos on Youtube

Kushan Randima
Author by

Kushan Randima

I focus on web development in particular. Most of my experience comes from using technologies like Angular, .NET, HTML, CSS, SQL & Azure.

Updated on September 18, 2022

Comments

  • Kushan Randima
    Kushan Randima almost 2 years

    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.

  • Davidenko
    Davidenko over 9 years
    Have you tried my answer? @KushanRandima
  • Kushan Randima
    Kushan Randima over 9 years
    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
    Kushan Randima over 9 years
    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/…