How can I issue system backup over SSH?

Display on my Xperia 10 is shattered and almost completely dead in terms of touch input.
Is there please equivalent command I could run over SSH to start the backup process? I can move files but I need the messages, contacts, notes, call history etc.

Unfortunately I do not think so:

But you will find on TJC all info how to do that step-by-step…
Maybe some one else has a link at hand with a comprehensive collection?

Would be worth to add here.

2 Likes

From above link or … or

Contacts:

devel-su -p vcardconverter -e contacts.vcf
or
devel-su -p vcardconverter --export contacts.vcf

Calendar:

devel-su -p icalconverter export calendar.ics

Messages:

commhistory-tool export -groups messages.exp

Calls:

commhistory-tool export -calls calls.exp

(both above working on DB file
/home/nemo/.local/share/commhistory/commhistory.db -->
so a simple
tar -cvzf commhist.tgz /home/$USER/.local/share/commhistory/
would also work

Notes:
for notes I do not know tool, so
tar -cvzf notes.tgz /home$USER/.local/share/jolla-notes/
will do the trick

9 Likes

A while ago I suffered the same fate, so I really sympathise: it’s not a nice situation to be in. At the time I wrote this script to trigger the backup from the UI when the screen is broken.

I wouldn’t recommend anyone use the script as-is, since the UI has changed and it almost certainly needs fixing up. However, if none of the other approaches do what you need let me know and I can update it, or maybe it can provide some inspiration. In practice, I think @peterleinchen’s suggestions are a better approach.

5 Likes

Thank you both,

I did use the commands provided by @peterleinchen.
I will just add the importing commands for reference:

Contacts:
devel-su -p vcardconverter --export contacts.vcf
restored manually from file manager

Calendar:
devel-su -p icalconverter export calendar.ics
restored manually from file manager

Messages:
commhistory-tool export -groups messages.exp
commhistory-tool import -groups messages.exp

Calls:
commhistory-tool export -calls calls.exp
commhistory-tool import -calls calls.exp

to restore:
tar -xf notes.tgz --directory=/

[edit]
All that remains is probably only the configuration data for few Android apps (not the user files). Don’t you know where that is stored? I don’t think there is any configuration inside /home/nemo/android_storage/Android/data/

5 Likes

Take a look at
/home/.android/
and backup completely…

(not yet tested) …and try to restore with AlienDalvik shut down on your new phone. Activate AD and probably install apps from ./data/app/zzz.yyy.xxx/base.apk
by file manager or apkd-install.
I do not know if this works for split APKs. Then just install normally.

Furthermore it is a good idea to create a full copy of /home/$USER (and probably /usr/share) in case you miss/want some other native app’s configuration data.

I guess about the normal user data like pictures, downloads and so on you are aware.
Maybe one notice regarding e-mail downloaded attachments (only relevant in case using POP): backup ./Downloads/mail_attachments/

3 Likes

Are you familiar with rsync? That’s what I use to backup my complete nemo directory , including application data and configs. You could exclude things like cache video directories.
t didn’t have to restore yet so I don’t know if it plays well with databases like those for contacts and calls. But theoretically the files should be in their respective paths.

1 Like

rclone is also worth a mention, since it supports a lot of different “cloud[1] sync” providers.

I use it for a daily photo & music sync and backup and for a weekly large backup.

[1] such an awful word

If I try vcardconverter to export my contacts I get a return code 0 and a contacts.vcf file, but for every contact I also get the following output to the commandline:
[W] unknown:0 - Variant value is a QStringList but the property's value type is neither CompoundType or ListType
What does this message mean?

Do you know how to manipulate this file format?

messages.exp

I still was not able to import my SMS messages from the N900 to the XA2 4.3.
I thought I could imitate the file format given by

commhistory-tool export -groups messages.exp

to convert my N900 messages.
Then, import them with

commhistory-tool export -groups N900_messages.exp

I did researches but didn’t find how to read/generate .exp files.

1 Like

Dear @omichalek,

how did you ssh into your phone when the screen was broken? It seems like your phone needs to be unlocked to start the ssh session. I currently can’t ssh onto my phone because of this.

Did you find a way to unlock your phone without the screen?

Kind regards.

Don’t have to be unlocked. The only requirement is that “Developer mode” and then “Remote Connection” must be enabled.

Thanks for your reply.

On my phone, they are enabled. I SSHed to my phone many times via Wifi before the screen broke.

I don’t think the phone connects to Wifi before I enter my PIN the first time (or does it? that would mean I only need to find out the right IP address, as none of the ones I used previously worked). So I tried having my phone connected to my laptop via USB C, but ssh defaultuser@192.168.2.15 only leads to ssh: connect to host 192.168.2.15 port 22: Network is unreachable.

I think the very least I need to do is selecting the right USB mode (file exchange, just charge, etc.) when the cable is connected to my phone. Which I can’t, as my screen is dead.

You are right I thought about screen unlocking. My mistake. You must unlock your phone prior to connection. Try Recovery Mode

1 Like

Thanks a lot, I’m going to try this!

Unlocked as in having entered the password? That would make sense, I must have written this before the user data encryption was in place…
With late SFOS versions, I often find that sshd service is stopped for no obvious reason :frowning: I have to devel-su systemctl start sshd which is extremely annoying because it should be enabled!