Move BC before/after reformatting
You can just copy your wallet.dat from your local wallet directory. If using windows it will be in %appdata%/Bitcoin. After reformatting download a fresh copy of Bitcoin Core and replace the wallet.dat with the one you saved prior to reformatting. 

There's also the method of using the backupwallet and importwallet commands. https://bitcoin.org/en/developer-reference#backupwallet