Skip to main content

Transfer JuiceSSH connection database to a new phone (root required)

 I've just replaced my 5 year-old phone with something new and shiny, and I'm in the process of migrating apps. My JuiceSSH instance has about 20-30 connections in it, which makes it cumbersome to type in again. Sadly, the app doesn't have (yet?) a method to export and import the database, so we must make use of root access.

Both my phones (source running Android 12, destination running Android 13) are rooted. 

Here are the steps:

1. Enable ADB debugging on both phones.

2. Connect via ADB to the source phone and become root. Navigate to JuiceSSH database directory and identify the database being used:

lavender:/ $ su -
lavender:/ # cd /data/data/com.sonelli.juicessh/databases/
lavender:/data/data/com.sonelli.juicessh/databases # ls -l
total 640
-rw-rw---- 1 u0_a221 u0_a221 462848 2023-12-25 07:50 19a093afcee2a1df8bb6ac14d79843
-rw-rw---- 1 u0_a221 u0_a221  25136 2023-12-25 07:50 19a093afcee2a1df8bb6ac14d79843-journal
-rw-rw---- 1 u0_a221 u0_a221  40960 2020-08-11 21:15 com.google.android.datatransport.events
-rwxrw---- 1 u0_a221 u0_a221      0 2020-08-11 21:15 com.google.android.datatransport.events-journal
-rwx------ 1 u0_a221 u0_a221  20480 2018-07-14 10:57 google_analytics_v2.db
-rwx------ 1 u0_a221 u0_a221   8720 2018-07-14 10:57 google_analytics_v2.db-journal
-rw-rw---- 1 u0_a221 u0_a221  28672 2023-12-25 08:07 google_analytics_v4.db
-rw-rw---- 1 u0_a221 u0_a221  12824 2023-12-25 08:07 google_analytics_v4.db-journal
-rw-rw---- 1 u0_a221 u0_a221  16384 2023-12-28 12:58 google_app_measurement_local.db
-rw-rw---- 1 u0_a221 u0_a221  25136 2023-12-28 12:58 google_app_measurement_local.db-journal
lavender:/data/data/com.sonelli.juicessh/databases # strings 19a093afcee2a1df8bb6ac14d79843 | grep 192.168.
m1192.168.1.24
xu4rm192.168.100.80
hc2-local192.168.100.5
... output ommited ...

3. Copy the database file to /sdcard

lavender:/data/data/com.sonelli.juicessh/databases # cp 19a093afcee2a1df8bb6ac14d79843 /sdcard/ 

4. On your PC copy the file over from /sdcard

$  adb pull /sdcard/temp/19a093afcee2a1df8bb6ac14d79843 .

5. Connect the new phone, connect via ADB and become root. Navigate to JuiceSSH database directory and identify the database being used. In my case it had the same name.

tundra:/ $ su -
tundra:/ # cd /data/data/com.sonelli.juicessh/databases/ 

6. On your PC push the file to /sdcard

$  adb push 19a093afcee2a1df8bb6ac14d79843 /sdcard/

7. On ADB copy the database to its new location

tundra:/data/data/com.sonelli.juicessh/databases # mv 19a093afcee2a1df8bb6ac14d79843 19a093afcee2a1df8bb6ac14d79843.orig
tundra:/data/data/com.sonelli.juicessh/databases # cp /sdcard/19a093afcee2a1df8bb6ac14d79843 .    
                        

8. Change ownership and permissions

tundra:/data/data/com.sonelli.juicessh/databases # chown u0_a341:u0_a341 19a093afcee2a1df8bb6ac14d79843
tundra:/data/data/com.sonelli.juicessh/databases # chmod g+w 19a093afcee2a1df8bb6ac14d79843
tundra:/data/data/com.sonelli.juicessh/databases # ls -l                                                                                                                                                          
total 916
-rw-rw---- 1 u0_a341 u0_a341 462848 2023-12-28 14:00 19a093afcee2a1df8bb6ac14d79843
-rw------- 1 u0_a341 u0_a341      0 2023-12-28 12:44 19a093afcee2a1df8bb6ac14d79843-journal
-rw-rw---- 1 u0_a341 u0_a341 389120 2023-12-28 12:44 19a093afcee2a1df8bb6ac14d79843.orig
-rw-rw---- 1 u0_a341 u0_a341  40960 2023-12-28 12:44 com.google.android.datatransport.events
-rw------- 1 u0_a341 u0_a341      0 2023-12-28 12:44 com.google.android.datatransport.events-journal
-rw------- 1 u0_a341 u0_a341  28672 2023-12-28 12:44 google_analytics_v4.db
-rw------- 1 u0_a341 u0_a341      0 2023-12-28 12:44 google_analytics_v4.db-journal
-rw-rw---- 1 u0_a341 u0_a341  16384 2023-12-28 12:59 google_app_measurement_local.db
-rw------- 1 u0_a341 u0_a341      0 2023-12-28 12:44 google_app_measurement_local.db-journal

 

9. Close JuiceSSH on the destination and restart it. You should see your connections and recent list. You can now try to connect and it should work.

Comments

Popular posts from this blog

Home Assistant + Android TV = fun

Here's a quick setup guide for controlling your Android TV from within Home Assistant. I've used it to control a genuine Android TV (Philips 7304) and an Odroid N2 running Android TV. For this to work you need ADB access. It can usually be enabled from within Developer Settings. The great part is - you don't need root access! The most important things are described in the androidtv component for Home Assistant: https://www.home-assistant.io/integrations/androidtv/ Make sure you go through the adb setup. My configuration is simple (inside configuration.yaml): media_player:   - platform: androidtv     name: TV Bedroom ATV     host: 192.168.1.61     device_class: androidtv Once Home Assistant restarts, your TV might require you to accept the connection (adb authentication). This happens only once (or until you reset your ATV to factory settings). Once running the integration will show you the current ATV state (on or off) and allows you to turn it on or off.

SmokePing + InfluxDB export + docker + slaves + Grafana = fun

I've been working for a while on this project - with the purpose of getting SmokePing measurements from different hosts (slaves) into InfluxDB so that we can better graph them with Grafana. The slaves run multiple Smokeping instances inside Docker so that they have separate networking (measure through different uplinks, independently). This will not be a comprehensive configuration guide, but a quick "how to" to handle setup and basic troubleshooting. It assumes you already know how to set up and operate a regular Smokeping install with or without slaves and that you are fluent in Smokeping configuration syntax, know your way around Docker and aren't a stranger from InfluxDB and Grafana (sorry, there's a lot of information to take in). 1. Getting Smokeping with InfluxDB support - you can get it either from the official page (most changes have been merged) - https://github.com/oetiker/SmokePing (PR discussion here: https://github.com/oetiker/SmokePing/issues/

Installing Home Assistant Supervised on an old 32bit HP laptop

 I've received a challenge from my former boss: an old HP laptop that was born in 2005:  an HP-Compaq NC6220 ( https://www.pocket-lint.com/laptops/reviews/hp/68181-hp-compaq-nc6220-notebook-laptop/ ). The specs are abysmal: So, i386, 1.7GHz single-core CPU (remember those?), 1G of DDR2 RAM (2x512M) and a 40GB ATA (not SATA!) drive. But hey, at least it has a serial port!  The challenge is to install HomeAssistant ( https://www.home-assistant.io/ ) on it so that he can monitor some Zigbee temperature sensors and relays (via a gateway). The first hurdle was to remove the BIOS password - following this nice guide: https://www.youtube.com/watch?v=ZaGKyb0ntSg Next-up - install HASSOS. Unfortunately, it doesn't support i386, but only x86_64... So, I went the Home Assistant Supervised route, and installed Debian 11 i386 edition from a netinstall USB ( https://cdimage.debian.org/debian-cd/current/i386/iso-cd/debian-11.6.0-i386-netinst.iso ).   Once Debian was up and running (didn't