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

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

Andy Branson gravatar image

updated 2016-08-17 10:50:15 +0300

jiit 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 /var/lib/connman/ from the old phone to the new. I used rsync on my old phone with this command:

rsync -avz -e ssh /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 /var/lib/connman, rename the directories with:

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

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

then change the files with:

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

That got things working for me!

edit retag flag offensive close delete



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

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

Really useful info. Thanks:)

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