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