Backup Wifi SSID and password on SGSII
On newer versions of Android, WiFi settings are backed up along with your Google account (If you've enabled it in Settings -&gt; Backup &amp; reset -&gt; Back up my data), and restored when you link your Google account back to your wiped or new device.

Note that in my personal experience, the Google backup feature is a bit flaky, sometimes it works, sometimes it doesn't. On new devices it usually works, but when wiping/installing ROMs it may fail.