MigrateContactsDatabase » History » Version 18
Denis 'GNUtoo' Carikli, 06/01/2021 10:14 AM
Remove TODO that is done
|1||1||Denis 'GNUtoo' Carikli||
|2||2||Denis 'GNUtoo' Carikli|
* This article is a work in progress
* It hasn't been tested yet and might contain mistakes
* It needs to be more clear for less technical users
|11||4||Denis 'GNUtoo' Carikli||
|12||1||Denis 'GNUtoo' Carikli|
|13||7||Denis 'GNUtoo' Carikli||
h2. Backuping your contacts in a file
|14||4||Denis 'GNUtoo' Carikli|
|15||7||Denis 'GNUtoo' Carikli||
Here's a way to do it:
|16||1||Denis 'GNUtoo' Carikli|
|17||7||Denis 'GNUtoo' Carikli||
First, you'll need to make sure Replicant is booted on the device and open the stock contact application.
|19||8||Denis 'GNUtoo' Carikli||
Then if it shows a screen with "No contacts." in it, you won't need to backup the contacts, you can skip this section (Backuping your contacts), but you'll still need to follow the rest of the tutorial if you don't want your device to crash when installing a Replicant version with a different contact database format.
|20||7||Denis 'GNUtoo' Carikli|
If it shows some contacts, you will then need to backup them to a file.
To do that you will first need to go in the contact application settings.
To do that, once you are in the contact application, you can press the settings button in the application or press the settings button (On the Galaxy SIII, it's the button on the left of the home button).
That will display a menu. You will then have to select "Import/export" and then "Export to .vcf file".
It will then display a new screen with many contacts.
You will need to again press the settings button and a new menu with only one option ("All [ ]") will appear.
You will need to select this option to select all contacts.
Once this is done, a new Tick button will appear in the screen. You will need to press it.
Once this is done you can save your contact to a file in the device, and copy that file somewhere safe (like on your laptop).
This way if you end up having to erase your data somehow, you will still be able to easily restore your contacts.
|40||4||Denis 'GNUtoo' Carikli|
h2. Setup ADB
Follow the instructions for [[ADB|setting up ADB on your computer]] so that you can access a root shell on your device.
*NOTE*: when prompted on your Replicant device, make sure that you check the box that says *Always allow from this computer* when you grant your computer USB debugging permissions. Otherwise, you will be unable to obtain root shell access on your Replicant device when you reboot it into the recovery OS to actually perform the backup.
*NOTE*: for security reasons, you may want to [[ADB#Revoking-all-computers-USB-debugging-permissions|revoke these non-expiring permissions]] once the backup is complete.
|49||12||Denis 'GNUtoo' Carikli||
h2. Reboot into the recovery
To reboot in the recovery, you can follow the instructions in the [[RebootIntoTheRecovery]] wiki page.
|53||6||Denis 'GNUtoo' Carikli||
h2. Mount the data partition
|55||14||Denis 'GNUtoo' Carikli||
You then need to mount the data partition.
|56||1||Denis 'GNUtoo' Carikli|
|57||14||Denis 'GNUtoo' Carikli||
For the @Galaxy S III (GT-I9300)@, and the @Galaxy Note 8.0 (GT-N51xx)@, you can use the following command:
|58||9||Denis 'GNUtoo' Carikli||
|59||13||Denis 'GNUtoo' Carikli||
mount /dev/block/platform/*/by-name/USERDATA /data/
|60||1||Denis 'GNUtoo' Carikli||
|61||9||Denis 'GNUtoo' Carikli|
|62||14||Denis 'GNUtoo' Carikli||
For the @Galaxy Note (GT-N7000)@, you can use the following command instead:
|63||11||Denis 'GNUtoo' Carikli|
|65||1||Denis 'GNUtoo' Carikli||
mount /dev/block/platform/dw_mmc/by-name/DATAFS /data/
|66||11||Denis 'GNUtoo' Carikli||
|68||14||Denis 'GNUtoo' Carikli||
Other devices / TODO:
|69||6||Denis 'GNUtoo' Carikli|
|70||4||Denis 'GNUtoo' Carikli||
TODO: other devices + background text.
h2. Erase your contact database
Once in the recovery, you will then be able to erase your contact database:
|76||2||Denis 'GNUtoo' Carikli||
|77||1||Denis 'GNUtoo' Carikli||
rm -rf /data/data/com.android.providers.contacts/databases/
|79||4||Denis 'GNUtoo' Carikli|
|80||15||Denis 'GNUtoo' Carikli||
Once this is done you will need to umount the userdata partition. This can be done with the following command:
|84||10||Denis 'GNUtoo' Carikli|
|85||4||Denis 'GNUtoo' Carikli||
h2. Install the new Replicant images
Once the backup is done, you can proceed to install the Replicant images that have the contact database format to migrate to.
h2. Revoke USB debugging permissions
If you don't need @USB debugging permissions@ anymore, it might be a good idea to remove them. The [[ADB#Revoking-all-computers-USB-debugging-permissions|Revoking all computer's USB debugging permissions]] section in the ADB wiki page explains how to do that.
|93||17||Denis 'GNUtoo' Carikli||
|95||16||Denis 'GNUtoo' Carikli||
That's it! Your contacts database is now backed up.
|96||17||Denis 'GNUtoo' Carikli|
h2. Extra information
The file you backuped your contact in is in the "VCard":https://en.wikipedia.org/wiki/VCard format. That format is a standard, and many other software are compatible with it.