How to Transfer Bitcoin wallet?

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