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 al...

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/...

Android: Adding scp/sftp support to dropbear and mounting with sshfs

I have recently received an android smartphone, and one of the first things I did with it was to root it :). This allows power-usres to get the most out of their hardware. The next thing on my list was to set up a SSH server and to be able to transfer files between my Linux system and my phone (by the way, I'm running Android 4.1 and it seems USB mass storage support has been removed. MTP/PTP modes have either horrible transfer speed or are poorly supported in Ubuntu). With the above in mind, the plan was to: Enable tethering on the phone Run a SSH server to support issuing remote commands and file transfer (FTP might have been an alternative, but I'm a SSH adept). Browsing the market I found  SSHDroid which does all that it advertised. Problem is - the free version conflicts with my add-blocking apps and requests that they are disabled to run. For me, this is a big nuisance, so I kept looking. I found Dropbear SSH Server 2 , which is completely free, but doesn'...