I recently upgraded to an iPhone 4S and decided to take with me all my previous settings with me using iCloud - very neat feature by the way. Every app, saved games, email accounts and contacts were imported from my old device but I still had to enter manually the credentials to use services like Twitter, Instapaper and Google Reader on third party apps.
Backing up your data with iCloud before the upgrade
As a reminder, simply say that Viber is a free app that allows you to place free calls using 3G data and Wi-Fi connection and WhatsApp does the same for texting. If you haven't experienced the benefits of these free apps, I recommend you have a look at my comparison with IM clients, using both to talk and text abroad for free and how to keep your data private.
First of all, Viber doesn't rely on usernames and passwords, it uses the mobile number and the device ID. I would expect to keep my old call history and text messages on the new iPhone 4S but it simply carries this information over.
Instead, I'm asked to register the device as a new user: this includes giving my mobile number, allowing the app to access my address book and type in a confirmation code sent via SMS. The process is fast and surprisingly similar for both apps.
At lest for the current version, Viber isn't backing up any of your logs and messaging history in a meaninful manner. Re-installing the app will erase all past calling history and texts, keeping only the contacts using Viber, which are obviously taken from your Contacts and cross-checked with Viber's user list. Having some sort of iCloud integration woud be fantastic - so far you only get the app itself as a backup.
Unfortunately, the way Viber work means that your account will be tied inevitably to your current device and will stop working anywhere else. There’s no notification about it either.
WhatsApp is a bit more user-friendly but not very clear if you really want to know where your messages are stored. After doing the initial setup with the new device - again sending your number and entering the confirmation code - your old messages will be there.
In fact, if you go to the settings tab and scroll to the bottom, you have the option to export via email specific chat conversations, clear chat history and exit all groups. Digging a bit more on the Help menu “How do I email or save my chat history” suggests that this information is backed up with every iTunes sync and refers to an Apple support page about updating and restoring your settings.
Not that I fully understand what happened there, but it seems that restoring my most recent iCloud copy to my new iPhone 4S was a good idea after all. I suspect a clean install would have wiped my chat history on WhatsApp.