How to backup Monero wallet – Exporting seed, keys in GUI and CLI wallet
Just like any other wallets you can create multiple wallet address in Monero. In Monero CLI wallet you’ll be initially asked to specify the wallet name. If the wallet already exists you can enter your password and proceed with it, if not you can create a new one. Even in GUI when you create a new wallet; by default it sets your PC user name for your wallet. Either you can change the wallet name or proceed with the one that is shown. If the wallet name which you specified already exists then an error message will pop up telling you to change the wallet name. So in both wallets you’ll be prevented from overwriting your existing .keys file.
However on Reddit we’ve seen users reporting that “I lost my Monero by accidentally overwriting my .keys file”. “My wallet files are corrupt and I failed to take a backup”. Missing a word from mnemonic seed / private keys  and several other stories where because of simple mistakes people are losing quite a large sum of Monero. Please don’t learn the hard way. Remember that there are chances that your system could fail anytime or even the drive where you stored the copy of your mnemonic seed could get corrupt. So take as much effort as possible and ensure that you have your backup ready to restore your wallet anytime.
This is a quick tip for beginners and a safety measure which you must consider if you are using Monero wallet. Here we’ll show you how to backup Monero wallet that is exporting mnemonic seed and private keys in both GUI and CLI wallet.
Backup Monero wallet – Mnemonic seed, and keys in GUI and CLI wallet
Within your wallet folder (Windows: Documents/Monero) you’ll find something called .keys file which is similar to wallet.dat file in Bitcoin. Having a copy of this file is fine which is encrypted as well. However the 25 words mnemonic seed which encode your private keys is the most crucial thing which you must backup first. Along with that it is also essential that you backup both private spend keys and view keys. If something wrong happens then these information is what helps in restoring your wallet.
If you’re wondering what’s mnemonic seed or how spend keys and private keys work then read this, this and this.
At the time of wallet creation you’ll be provided with the mnemonic seed. It tells “This seed is very important to write down and keep secret. It is all you need to backup and restore your wallet”. Not a problem if you didn’t write this down. In both GUI and CLI wallet we can obtain this information anytime.
GUI wallet:
In GUI wallet under settings you’ll find something called “Seed and Keys”. Click that, enter your wallet password and copy the Mnemonic seed and the keys below that.
Mnemonic seed is sufficient as long as you have the information correct. However there are chances where we might misplace seed words so in addition to that it is advised to backup both spend key as well as view key.
CLI wallet:
In CLI wallet obtaining both Mnemonic seed and private keys is simple. All you have to do is open the wallet and wait for it to load completely. Once it is done type the following.
seed
>> hit enter to know the 25 words Mnemonic seed.
viewkey
>> hit enter to view public and secret view key.
spendkey
>> hit enter to obtain secret and public spend key.
For each command you’ll be asked to input your wallet password. Also if you are wondering what private and public keys are then read this post here.
That’s it. You now have your wallet Mnemonic seed, private keys and wallet keys file. Instead of copying these information in a text file it is advised to write down on paper. Store all these information in a safe place and ensure that these backups are only accessible to you.
Additional Read:
Changing Monero wallet blockchain data location