Share known WiFi networks between own devices
If you want to back up and restore though Google (Drive) then perhaps you  may need to look at some third-party applications such as
WiFi Password Manager or Wi-Fi password manager (whichever you prefer as there are more or less similar)

Basically the following features are present:


  
  Manage your wifi passwords (add, edit, delete)
  Backup your passwords to Google Drive or to local storage
  Wifi hotspots list sorted by wifi signal strength
  Recover wi-fi passwords from system settings (ROOT)
  Connect to WiFi hotspot directly from the appplication
  Copy password to clipboard
  Share wi-fi settings
  


Pretty straight forward to use simply add the target wi-fi network, then back it up on local or google drive, follow the reverse proceedure to restore: