The procedure for backing up and restoring Cheogram app data depends on your needs. We'll consider three cases:
- Replace a previous device with a new one where the old device will not be used and without needing the attachments from conversation history beyond what's saved on the server.
- Replace a previous device with a new one where the old device will not be used and the attachments from conversation history should be preserved and migrated.
- Backup a previous device and use both the previous device and a new device with conversation history and attachments on both devices.
Below are general steps for each case.
1. Replace a previous device with a new one where the old device will not be used and without needing the attachments from conversation history beyond what's saved on the server
There are two methods to accomplish this: use file backups (CEB files) or use an OS backup (e.g. Seedvault).
Using backup (CEB) files
- Ensure that you know the usernames (JIDs) and passwords for all of your accounts
- Put the previous device in Flight Mode
- In the Cheogram app on the previous device, tap the three dots menu
- Tap Settings
- Tap Create backup (This generates a CEB file for each of your XMPP accounts)
- Use a file explorer app or adb to copy the CEB files to the replacement device.
- On the replacement device, install the Cheogram app and start it
- Tap restore from backup
- Restore each CEB file
- After you verify that the replacement device's app is working and has the conversation history you want, remove the app from the previous device or delete the app's data. (This prevents the previous device from conflicting with the new device.)
Using an OS Backup like Seedvault
- In the Android Settings, tap System -> Backup -> Seedvault backup
- If the Backup location is an external USB flash memory, insert it
- Click Backup status and verify that the Cheogram app has a green check mark and recent date indicating a successful backup.
- If Cheogram is not backed up, the data might be too large. Seedvault has an Expert setting for Unlimited app quota which might help get a backup
- Safely remove the USB flash memory and insert it into the replacement device
- On the replacement device, tap Settings -> System -> Backup
- Tap Automatic restore
- Install the Cheogram app and let it restore from the Seedvault backup
- After you verify that the replacement device's app is working and has the conversation history you want, remove the app from the previous device or delete the app's data. (This prevents the previous device from conflicting with the new device.)
2. Replace a previous device with a new one where the old device will not be used and the attachments from conversation history should be preserved and migrated.
There are two methods to accomplish this: use file backups (CEB files) or use an OS backup (e.g. Seedvault).
Using backup (CEB) files
- Follow steps 1-5 from the Using backup (CEB) files procedure above
- Use a file explorer app or adb to copy the following paths to the replacement device:
- Pictures/Cheogram/
- Downloads/Cheogram/
- Movies/Cheogram/
- Documents/Cheogram
- Use the following commands via adb to fix the security context of the copied files.
adb shell content query --uri content://media/external/file | grep 'owner_package_name=NULL' | grep -c "Cheo"
adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/images/media --where \"relative_path=\'Pictures/Cheogram/\'\" adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/video/media --where \"relative_path=\'Movies/Cheogram/\'\" adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/audio/media --where \"relative_path=\'Download/Cheogram/\'\" adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/downloads --where \"relative_path=\'Download/Cheogram/\'\" adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/file --where \"relative_path=\'Documents/Cheogram/\'\" adb shell content update --bind owner_package_name:s:com.cheogram.android --uri content://media/external/file --where \"relative_path=\'Movies/Cheogram/\'\"
Double check:
adb shell content query --uri content://media/external/file | grep 'owner_package_name=NULL' | grep -c "Conv"
- On the new device, install the Cheogram app and start it
- Tap restore from backup
- Restore each CEB file
Using an OS Backup like Seedvault
- In the Android Settings, tap System -> Backup -> Seedvault backup
- Tap to turn on the (experimental) setting Backup my files
- Follow the steps in the previous section for Using an OS Backup like Seedvault
3. Backup a previous device and use both the previous device and a new device with conversation history and attachments on both devices
- Follow the steps in the previous section
- Verify that the replacement device is working as desired
- With the previous device still in Flight mode, delete the previous device's Cheogram app's data
- In the previous device's Cheogram app, tap the three dots and select Manage accounts
- On the previous device, re-add all of the accounts to the app
- On the previous device, verify that recent conversations are shown. (The history will be limited to what's preserved on the server.)