Programmatically add wifi networks on Android
I've also had the same problem with losing all WiFi networks when upgrading LineageOS, so I've written a tool which will convert your old wpa_supplicant.conf to new WifiConfigStore.xml (and I'm not using Google accounts or other "upload all my stuff to some cloud" privacy nightmares)

You can find it here: https://github.com/mnalis/android-wifi-upgrade

Even with just SSID/passwords list and without original wpa_supplicant.conf file, file format for WifiConfigStore.xml is not really complex (it is just very verbose). With minimal programming you can use template in my code used for filling it to replace $SSID and other variables in order to generate it from your list).

Note that it will require root (or recovery rom with full adb or filemanager access) on your new android device in order to actually upload newly created WifiConfigStore.xml to the phone.