File with Bluetooth paired devices?

Guys, what is the configuration file storing paired Bluetooth devices?

I’ll need to reflash the phone, but for some reasons I would like to avoid having to re-pair it then with my car kit.

Is there a file containing the paired devices data that I could just copy?

1 Like

Backing up /var/lib/bluetooth might work, but I have not tested that, so no guarantee…

2 Likes

OK, thanks! I’ll try it and report here about the results :grinning:

you have following directory structure
/var/lib/bluetooth/ADAPTER/PAIRED_DEVICE

you should not mess up with that - rather use the interface bluetoothctl

I’ve gzip’ed the whole structure. I’ll restore it after I reflash the OS and see what happens.

OK, so after reflash I’ve restored the gziped content of /var/lib/bluetooth and all my previously paired devices appeared as paired and are working OK.

So this is a very easy way to backup Bluetooth pairings.

7 Likes

This only works within the same device I think, because the adapter’s own MAC address is part of the folder structure… Moving the “history” to another device doesn’t make sense though, because the client devices won’t recognize the new device anyway.

Yes, it is a backup that will work only if restored to the same device. But it’s still very useful, e.g. in case of my car kits which make problems when pairing. As long as I don’t delete the pairing from the car kit side, I can always restore this backup to my phone (e.g. after reflash) and instantly have a working pairing.