Transfering WLAN data from XA2 to 10 III

Transferring the backup sailfishxxx.tar from my XA2 to my new 10 III was successful, but I had to delete the folder Notes from the tar file. Good so far. Both devices running with 4.4.0.64. But not all data is transferred by this procedure. E.g. wlan data.
I used a lot of wlan networks on my XA2. I wonder if there would be a possibility to transfer this data to the 10 III to? Probably by copying some folders …?..
Do I have a chance to do that and if, how?

Best regards, Uwe.

Seems not very easy to transpose…

Wifi connections and passwords can be found in

/home/defaultuser/.local/share/system/privileged/connman/

The first part of the directories found there (e.g. wifi_xxxxxxxxxxxx_[yyyyyy…]_managed_psk), in my example the xxxxxxxxxxxx part, is the WIFI MAC address of the phone. This part changes from one phone to another, hence hard to transpose.
I wasn’t able to use the WIFI points from one phone to another, even by renaming these folders with the correct MAC address. The second part (yyyyy) must be an identifier which is perhaps linked to the access point name.
So, if you rename the folders with the new phone MAC address, the access points are shown, but instead of their name, I had a list of Hidden network.

An alternate solution would be, at least, to manually retrieve the passwords which are stored in the settings file, into each /home/defaultuser/.local/share/system/privileged/connman/wifi_xxxxxxxxxxxx_[yyyyyy…]_managed_psk/ directories.

Thank you very much for your information. I’ll have a look into it, but now it seems that it might be not worth it to invest to much energy into this project…

Best regards, Uwe.

Hi ric9k. I got it working! What you suggested is ok. You have to change the MAC in foldername and in settings. the second part yyyyy is the SSID, which does not change.
So I copied (at the moment) only one of the wifi folders from XA2 to 10-III, which is quite tricky because of rights. I will describe the method, when I did a little bit more “research”. But what I don’t see with Putty in /home/defaultuser/.local/share/system/privileged/connman/ are the original folder and file rights. If you know what has to be set there, that would be great…
After restarting the 10-III I have this copied wlan fully working!
Thanks so far for your help.
Best regards, Uwe.

What I did for transferring wlan data from a XA2 to a 10-III:

  • Establish a wlan connection with Putty and WinSCP
    first with XA2 logged in as nemo on WinSCP an nemo/devel-su on Putty,
    later on for 10-III logged in as defaultuser on WinSCP an defaultuser/devel-su on Putty

  • On XA2:
    mkdir /home/nemo/Downloads/TEMP
    cp -R /home/nemo/.local/share/system/privileged/connman/* /home/nemo/Downloads/TEMP
    Copy the content of /home/nemo/Downloads/TEMP to a PC

  • On PC:
    In this folder there are a lot of folders each for every wlan. Looks like
    wifi_38786264bb0a_756c46_managed_psk

    38:78:62:64:bb:0a is the mac address of XA2, 756c46 represents the SSID

In such a folder there exists a settings file.

Now one has to change the mac address part in the foldername to the mac address of the 10-III. In settings there is also an entry with the foldername. Change there the mac also.

Do this for all wifi folders and their settings file.

  • On 10-III:
    mkdir /home/defaultuser/Downloads/TEMP
    With WinSCP copy all changed wifi folders from the PC to this folder.

    cd /home/defaultuser/.local/share/system/privileged/connman/
    cp -R /home/defaultuser/Downloads/TEMP/wifi* . (don’t forget the dot)

    chmod 700 wifi*
    check with mit ls -l. Result looks like:

    drwx------ 2 root root 4096 Jun 27 16:42 wifi_3c01efab11cd_756c46_managed_psk

In every wifi folder we now set the rights to 600:

[root@Xperia10III connman]# chmod 600 wifi_3c01efab11cd_756c46_managed_psk/*

Check (if you like) with: ls -l 3c01efab11cd_756c46/*
-rw------- 1 root root 72 Jun 27 10:09 wifi_3c01efab11cd_756c46_managed_psk/history.home.day
-rw------- 1 root root 600 Jun 27 16:00 wifi_3c01efab11cd_756c46_managed_psk/history.home.hour
-rw------- 1 root root 279 Jun 27 10:09 wifi_3c01efab11cd_756c46_managed_psk/settings
-rw------- 1 root root 208 Jun 27 16:19 wifi_3c01efab11cd_756c46_managed_psk/stats.home

Finish with a reboot of the 10-III.

Best regards, Uwe.

You could also make a tar archive with the ‘p’ option and extract it to the new device. Or enable root login via ssh and copy directly as root.

Because I changed folders and files on a Windows PC the linux rights got lost. That’s why I had to set the rights on the 10-III manually. I think if using a linux PC or server instead of a Windows PC it would be a little easier.
Best regards, Uwe.

Good progress, cool!
Sorry, I almost missed your answer. Don’t hesitate to use @, e.g. @uwelabs, when replying to someone so they get notified.
Yes, imho, tar is the best option as it preserves rights. Just be careful to be in the correct directory when you uncompress/unarchive your files.

Oh, and to replace the same character string in a bunch of filenames or dirnames, (e.g. in our case replace the mac address in all dirnames by another mac address), one can do:

for dirname in $(find /home/defaultuser/.local/share/system/privileged/connman/wifi* -type d) ;do mv $dirname $(echo $dirname | sed -e s/xxxxxxxxxxxx/yyyyyyyyyyyy/);done

where xxxxxxxxxxxx is the initial mac address and yyyyyyyyyyyy is the new mac address.

@ric9k. Thanks for this hint. I’ll try that with annother 10-III I’ll have to migrate.
Best regards, Uwe.