How-to: Copy Wi-fi connection settings to a new device

asked 2016-07-21 02:45:08 +0300

Andy Branson gravatar image

updated 2019-12-26 18:05:36 +0300

Sebix gravatar image

With new phones being launched, lots of Jolla1 owners are transferring their settings and data from their old phone to the new. Backups will do some of the work, but one thing not included is the list of Wifi networks and passwords that you might have collected over the years. Here's how I did it:

Copy the contents of /home/.system/var/lib/connman/ (in previous versions /var/lib/conman) from the old phone to the new. I used rsync on my old phone with this command:

rsync -avz -e ssh /home/.system/var/lib/connman/* nemo@newphone:~/temp/

Then copied the files from /home/nemo/temp as root on the new phone to their proper place.

At this point you'll be able to see the networks in the Settings UI, but your phone won't use them. That's because connman puts the phone's hardware address in the directory name and settings file of every network, so you'll have to change them. You can get your new address by checking the wifi network in ifconfig, or just create one wifi network on the new phone and check the directory name. The directories are named wifi_[mac address]_[ssid code], so it's the second element of the name you want.

From `/home/.system/var/lib/connman/ (or /var/lib/connman on older phones), rename the directories with:

rename -v <old-hw-addr> <new-hw-addr> wifi_*

e.g. in my case it was rename -v 5056a8011500 5056a8050600 wifi_*

then change the files with:

sed -i 's/<old-hw-addr>/<new-hw-addr>/' wifi_*/settings

That got things working for me!

edit retag flag offensive close delete

Comments

3

Can anyone create an utility to do that? Too complicated for humans..

palikao ( 2016-07-21 10:54:38 +0300 )edit
1

Really useful info. Thanks:)

richardski ( 2016-07-25 10:21:56 +0300 )edit

On 3.2.0 the directory /var/lib/conman is empty except for files called migrated and migrated.vpn

Sebix ( 2019-11-26 12:05:57 +0300 )edit
1

The location has changed to: /home/.system/var/lib/connman

jollauser ( 2019-12-02 19:47:08 +0300 )edit

AFAIK, "/var/lib/conman" is the default STORAGEDIR, see https://git.kernel.org/pub/scm/network/connman/connman.git/tree/doc/config-format.txt. SFOS now set the location in "/etc/connman/main.conf". I get the mac address like this: ifconfig wlan0|grep HWaddr|awk -FHWaddr '{print $2}'|sed 's/[ :]//g'|tr A-Z a-z.

A.Maretzek ( 2019-12-16 01:47:46 +0300 )edit