Restore keys from keypool So, I generated a new address with getnewaddress and made a payment to it. Soon after the computer bitcoind ran on shut down (due to loss of power) and after booting it up again my wallet doesn't know of the address anymore. I'm assuming all that happened was that the newly generated address wasn't written to disk in time. But the keys should still be in the keypool, right? How do I restore the keys and import them into the wallet? I still have the address.
Keypool keys are already in wallet.dat.  That's the whole point of the keypool.  When you run getnewaddress, you get the address corresponding to the oldest key in the keypool, and a new key is generated and added to the keypool to take its place.

So if your hypothesis is right, the key is still in the keypool, and if you execute getnewaddress again, you should get the same address as you got before.  Then you'll know you have the key.  bitcoind may not expect that there are already transactions on that address, so you might have to run bitcoind -rescan to pick them up.