How do I transfer all funds from one wallet to another? I have some bitcoins in an old bitcoin-core wallet and would like to transfer all of them to a new BIP32 wallet. I tried doing sendtoaddress with subtractfeefromamount=true, but bitcoin transferred all but 0.0005BTC to the new address (I suspect some rounding issue when calculating the fee and amount to send). So now I have an address with 0.0005BTC (plus some other addresses with a larger amount). How can I reliably transfer all funds so that all the addresses in the old wallet have zero balance?

Furthermore, is there a way to verify that all addresses for which I have the private key have a zero balance?
You can create a transaction having an output value equal to the entire balance of your bitcoin core wallet. The last parameter of sendtoaddress is a boolean signifying whether to include transaction fees or not, which you can set as true. The sendtoaddress API has a mechanism of generating a new address for the change remaining from the value you have given.

Another way would be to manually create the transaction with all the inputs from the addresses which have balance and sending it to the new wallet address. Remember to keep some difference in the input and output of the values which would be treated as transaction fees.

As for the last question, if your question is pertaining to the addresses in your old bitcoin core wallet, then you can use the listaddressgroupings API to get a detailed balance of each of the address your wallet has created. 
If the addresses don't belong to a core wallet, then you can simply search for the balance on https://blockchain.info/address/&lt;your_address&gt;