Migrate data from device to device
-
Consider this my "log" how I've transferred data from phone to phone (worked between two nexus 5 devices) without SD card
I hope it will be helpful for somebody - but I've basically used combination of two methods described before plus some man pages
NOTE: both devices have ubports image installed and are prepared for adb access ()Source device
After connecting source device on PC commands in terminal as follows:
- Reboot phone into recovery:
adb reboot recovery
- Acquire root:
adb root
- Activate shell:
adb shell
(command prompt will change to#
sign) - Backup system-data (this will also create log files, that can be examined for possible errors) :
tar -czpv -f /system-data.tgz /data/system-data/ >/system-data.out 2>/system-data.err
NOTE: I've just put these files into root directory and it went just fine and pulled just one file into connected computer since adb has much better chance to transfer one big file without errors than many small ones - logout from shell to your terminal (
Ctrl+D
)
NOTE: I am assuming computer is linux with root access etc.
this sub-step can be done before step 3
5.1 go to directory where backup data are to be stored in PC (usingcd
andmkdir
commands) - transfer data from phone to PC
adb pull /system-data.tgz
6.1 it is good idea to have logs copied tooadb pull /system-data.out
andadb pull /system-data.err
but it is not necessary - steps 3. to 6. repeat but with
user-data
instead ofsystem-data
excluding.cache
folder
(so commands will look liketar -czpv -f /user-data.tgz /data/user-data/ --exclude='*data/user-data/phablet/.cache*' >/user-data.out 2>/user-data.err
,adb pull /user-data.tgz
etc.)
NOTE: data which can be transferred by MTP should be moved that way since process of packing can take quite long for user data and may even stop/fail (e.g. not stopping process, just waiting and overheating battery, because all outputs are transferred to log files) if there is not enough space for package
Destination device
- Reboot phone into recovery:
adb reboot recovery
- Acquire root:
adb root
- Push archived data from PC to phone (root folder)
adb push ./system-data.tgz /
andadb push ./user-data.tgz /
NOTE: in case of failure pushing both files and then unpacking both in adb shell it is possible to work the process "per partes" so following steps 4. and 5. will be done after each push and removing archive from phone (rm ./system-data.tgz
in adb shell and then returning byCtrl+D
to PC shell) - Activate shell:
adb shell
(command prompt will change to#
sign) - Extract archives
tar -xzv -f /system-data.tgz
andtar -xzv -f /user-data.tgz
- Restart phone, unplug, recharge (battery will be probably rather low ) check data and switch SIM card
PS:
After finishing and documenting the process, I'we found out that WiFi settings has not been transferred to destination device those must be somewhere in
.cache
folder then (I don't really mind, messages, apps, contacts and other settings are quite enough for me) - Reboot phone into recovery:
-
This is great information and thank you guys for the guide. It truly helped me migrate from an M10 with a shattered screen (but the touchscreen still works) to a new one with bigger storage. But I'd like to make my own recommendation on top of this. @thepeter recommends to exclude
*data/user-data/phablet/.cache*
. This makes sense in general (most app cache directories are pretty disposable and will be rebuilt automatically and as necessary on your new device), but I would take an extra (as in, separate from the main archives you compress) .tgz archive of.cache/libertine-container/
(if you have one or even more than one container) as this will copy over all Libertine apps, app icons, dependencies, the container's rootfs etc. It's arguably just as important as user-data.tgz as that one copies the main Ubuntu Touch apps.Are there any other directories within
.cache
which people think would be worthy of backing up and migrating, for genuinely useful and essential stuff like the Libertine apps, and so which should be made an exception to the exclusion command criteria? -
I'm probably asking too much, but it can't hurt to ask...
Is there any method to migrate data from device to (identical) device that does not involve the command line? I'm not a friend of the terminal at the best of times, and that's on a laptop. The terminal on UT, I'm sorry to say, makes me cry for my mother.
-
@moem If you have a nextcloud, you can use UBsync to sync all the data you need.
You could even sync your .config folder to keep app-configs.
But apps itself, should be reinstalled I think. -
A "Save & restore" app would be so usefull in open-store... I'm really not confident with command line.
-
@moem
AFAIK and at this point the answer is no.
BTW I don't think having different Ubuntu Phones would be an issue except if you want to migrate data from a 16GB to a 32GB (or else, but you get the idea)...
I think an app makes sense but it will have to be unconfined in order to do the job. -
@applee said in Migrate data from device to device:
it will have to be unconfined in order to do the job.
Yes like some others ones very usefull (UTTT not to say for ex) ^^
-
@luksus said in Migrate data from device to device:
If you have a nextcloud, you can use UBsync to sync all the data you need.
Why would I need other people's computers for that? Can't I just use one of my own?
-
@moem sure install a nextcloud instance on your pc and sync your data to it.
-
@applee said in Migrate data from device to device:
AFAIK and at this point the answer is no.
Okay, thank you. That is most regrettable. But now that I know, I can stop searching.
I think an app makes sense but it will have to be unconfined in order to do the job.
I have no idea what that means but I don't think it would help me if I did.
-
@moem said in Migrate data from device to device:
I have no idea what that means but I don't think it would help me if I did.
He talks about access to all data with r/w rights on the device, like UTTT do.
-
@moem What sort of data do you want to migrate? If it is in File Manager perhaps you could copy it to a computer and from there to your other phone. I know it works moving photos to and from the phone though I have not tried other sorts of data.
-
@cliffcoggin said in Migrate data from device to device:
If it is in File Manager perhaps you could copy it to a computer and from there to your other phone.
Thank you Cliff! I have done almost exactly that: I connected both phones to my laptop with USB cables, and copied my photos directly from one phone to the other. I have also moved my exported contacts and my custom ringtone in a similar way. Those things were the most important bits of data, so I'm well on the way.
My app settings and settings of the phone itself, well, I'll just have to redo them. Not a very big deal.Also: whenever I want to move a small bit of data (such as some words or numbers and it's too much to type over... or one image) from one phone to another or from phone to laptop or vv, then I just send it to myself through Telegram / Teleports.
So there's not one streamlined solution, but there are a number of usable workarounds.
-
@moem I am all for the simplicity of a cable connection and a point&click mouse. Have you given up with your old phone?
-
@cliffcoggin said in Migrate data from device to device:
Have you given up with your old phone?
Not at all! In fact, I have moved from the beat-up-but-functional OpO that I got cheap to experiment with, to the good-as-new one that was running LineageOS up to yesterday. Because by now I figure that the experiment is over, the results are in, and UT is here to stay.
The 'beater' phone is going to be handed over to a developer I know who may be able and willing to help with Axolotl, the UT client for Signal. He can borrow it so he can, in turn, use it to experiment. And hopefully Axolotl will be gaining some improvements. In short, everyone wins here.Remarkably, installing UT was a lot easier this time, it went pretty smoothly. I believe there have been some helpful changes to the installer.
-
-
@thepeter just to add that if /data doesn't contain system-data and user-data (better said it is just empty) thing that might help is on phone side mounting it by:
mount /data
that should help (thanks to people in telegram group for quick help)