Move from one (broken) L5 to a new one

I was in the need to copy everything from my daily driver L5 to a new one to send the old one for display repair. The new L5 was already prepared:

  • Wifi configured
  • GnuPG and OpenPGP card configured
  • password-store was copied already and crypted with the new OpenPGP card
  • applications were installed (I have a list of all what was installed with apt install ... in my old L5)

Below are the steps what I did and what makes the new phone working now as the old one. HIH someone in the same situation:

Steps to move from the old L5 to the new L5, May 2024

1.  backup /home/purism with tar (script /home/
    the script does in principle as root:
    # cd /home
    # tar czf backup-purism-20240530.tgz purism
    and scp the file backup-purism-20240530.tgz to my laptop C720;

2.  remove all files /home/backup-purism-*

3.  in the new L5:
    - copy over the from C720 the file backup-purism-20240530.tgz to /home
    - SSH to the new L5
    # mv /home/purism /home/purism.saved
    # tar xzf backup-purism-20240530.tgz

4.  the config of GnuPG, of the OpenPGP card and the password store
    have been already done and are fine in the new L5
    and we copy over the dirs resulted from this
    configuration for this OpenPGP card:
    # rm -r  /home/purism/.gnupg /home/purism/.password-store
    # cp -Rp /home/purism.saved/.gnupg /home/purism/
    # cp -Rp /home/purism.saved/.password-store /home/purism/

5.  test the new L5 ([v] means test passed fine):
    - [v]  SSH into L5
    - [v]  test USB-tethering
    - [v]  test MUA mutt (script ~/     
    - [v]  test password-store with 'pass test'  
    - [v]  test firefox    
           crashed on first start, but then worked, RT DE needs entry in /etc/hosts:
    - [v]  test SSH to
           needs in addition:
           export pub SSH key with:
           gpg --export-ssh-key guru >
           and add it in remote ~/.ssh/authorized_keys
           needs in /etc/ssh/ssh_config:  PermitLocalCommand yes
    - [v]  scp from the old L5 the modified /usr/bin/scp command
    - [v]  test scp to
    - [v]  test contacts      
    - [-]  test Chatty nok
           has only older chats from the cuban SIM, because the SIM is still in
           the old L5
    - [v]  test new L5 as Hotspot

6.  copy over the WLAN credentials of NM from the old L5 to the new L5
    on old as root run:
    # tar cf nm-system-connections.tar /etc/NetworkManager/system-connections/
    pull the file to the laptop and scp it to the new L5:
    $ scp -p purism@l5:nm-system-connections.tar .
    $ scp -p nm-system-connections.tar purism@
    on new L5 as root do (to not overwrite already exsiting files):
    # tar xf nm-system-connections.tar
    # cd etc/NetworkManager/system-connections
    # ls /etc/NetworkManager/system-connections/
    # rm local.nmconnection cubacel.nmconnection Hotspot.nmconnection tarara.nmconnection
    # cd ..
    # tar cf system-connections.tar system-connections
    # cd /etc/NetworkManager
    # tar xf /home/purism/etc/NetworkManager/system-connections.tar
    restart Wifi and test SSH to the new L5
    remove nm-system-connections.tar and etc/NetworkManager/system-connections

7.  power down both L5 and insert SIM and SD into the new L5

8.  [v] test WWAN, Call and Chatty (all fine)

Today I did on the old L5 the final removal of security related information before handing it over to the repair shop:

power up the old L5 and do

9.  remove all files in /etc/NetworkManager/system-connections/
    BUT NOT:
    (if you remove local.nmconnection, USB tethering stops working)

10. remove all files and dirs below ~purism/
    BUT NOT:
    done with as root:
    # cd /home
    # mkdir npurism
    # chown purism:purism npurism
    # mv purism/.ssh bpurism
    # rm -r purism
    # mv npurism purism

11. do a final test to see if SSH and SSH through USB tethering are still working

12. change the psk values in the files to hidden ones

12. change the psk values in the files to hidden ones

13. power down the old L5 and remove the OpenPGP card

14. hand-over for repair

We will see how the techies who normally repair iPhones (…) will do the display swap scheduled for today afternoon.


I needed to do the same, but I used an image created with jumpdrive to make an exact copy of my first L5.


Sure. In my case this wasn’t an option due to the GnuPG, OpenPGP card and crypted ~350 credentials. I did not wanted to move the OpenPGP card because I hope after the display swap I can just restore the tar in it and all is fine in both devices.

1 Like

For that scenario your method is a better solution. Thanks for sharing.


I discovered yesterday that there appears to be no good method to import contacts from a file (such as csv) in to or out of Gnome Contacts. I don’t want to connect to my google contacts from Gnome Contacts, which Gnome contacts appears to be able to do. I never want to associate my Librem 5 to Google in any way. So I would like to export my Google contacts from my Android phone (or from my Google account on my PC), in to a csv formatted file. Then I’ll cull that list, update any empty fields, and then save as csv. Then I want to import that csv file in to Gnome Contacts. That should be a clean way to sever ties with Google with respect to my contacts. Later, I can find a way to sync Gnome Contacts to a safe place to keep my contacts backed up. Anyone here find a good solution to this?

1 Like

Export Android contacts as .vcf file, move .vcf file to Librem 5, import .vcf file from phosh Contacts app settings menu.

1 Like

Each VCF file appears to correspond to only one contact. If I have hundreds of contacts, do do I have to export/import each one, one at a time?

1 Like

Exporting from Android should produce a single .vcf file containing all your contacts.

1 Like

Thanks! That’s what I’ll do.

1 Like

From my file about hints and tricks for the L5:

44 How to export and import contacts

   Export all contacts to a VCF file:

   syncevolution --export /home/purism/guru/contacts.vcf backend=evolution-contacts

   Wipe out all contacts:

   syncevolution --delete-items backend=evolution-contacts --luids '*'

   Import contacts from a VCF file:

   syncevolution --import test.vcf backend=evolution-contacts
   #0: pas-id-552B785D00000008

   For more operations see also:

Import and export of Contacts | BQ Aquaris E 4.5 Ubuntu phone


I gave the L5 and the display to the repair shop and after an hour or so they phoned me that the L5 was booting again and only the glue must still get hard.


I re-created /home/purism from the tar-file above mentioned, re-installed all /etc/NetworkManager/system-connections/* files and everything was working as it should; tested:

[v] boot and unlock
[v] both cameras
[v] WLAN
[v] WWAN and Internet
[v] WLAN hotspot mode
[v] phone calls in/out
[v] proximety sensor during calls
[v] OpenPGP card
[v] USB tethering
[v] GPS: sudo guru/ TTFF: 565.2

the TTTF shows, that the repair did not broke the GPS antenna:

purism@old-pureos:~$ date
Thu 13 Jun 2024 07:39:38 AM CEST
purism@old-pureos:~$ sudo guru/

GPS 0.3
longitude      xx.62273183
latitude       xx.05254367
altitude (m)   545.14
accuracy       6.3
fix            3D
View sats
S26:18.0 S31:25.0 S02:19.0 S01:13.0 S28:30.0 S22:15.0 S29:28.0 S11:17.0
Solution sats
S26:18.0 S31:25.0 S28:30.0 S29:28.0
timestamp      2024-06-13 05:37:24.64
Fix time       1718249844.000
TTFF           565.2