Cosmos adoption is growing and meanwhile more nodes run every day the Cosmos software and at the same time the blockchain is growing and up a node and sync from scratch can take some time, the best practice, if your plan is run a node in the long term, is make one backup file from the database folder that contains the blockchain data.
This data is needed for run a node and sync the last block after the backup file was created, this backup file can be used for the node where was made or for up a new node, can share the file because no contain any personal or private data, only the blockchain record.
The steps are very simple and are described in this post
First need stop the cosmos software AkA gaiad, after stop and be sure the Cosmos program is stop, in that moment can start the backup process.
After stop open the directory where is located the folder that contain the data for make the backup file.
In that directory is the folder data, compress that folder
tar -czvf data.tar.gz data
Now have a Backup file and the original folder
can start the cosmos software again.
Using the backup file
If / when need use the backup file, stop Cosmos software gaiad and go to the directory
remove the actual database for decompress the backup file after that
rm -rf datatar -xzf data.tar.gz
Ok, after decompress and start Cosmos again, have to start to sync the last block when was made the backup file.
In case you are looking for, here is one backup for the actual mainnet for the Cosmos Hub-2, the plan is upload the link here meanwhile the file is update time to time, this is the last:
wget 'https://ipfs.io/ipfs/QmdQFjRboJAXRNLMZtUfP2gLBSNHVArDYeVmaEHR1Vf4Nw' -O data.tar.gz
wget 'https://gateway.ipfs.io/ipfs/QmdQFjRboJAXRNLMZtUfP2gLBSNHVArDYeVmaEHR1Vf4Nw' -O data.tar.gz
#for applying the backup after download
#stop gaiadcd .gaiadrm -rf datawget 'https://ipfs.io/ipfs/QmdQFjRboJAXRNLMZtUfP2gLBSNHVArDYeVmaEHR1Vf4Nw' -O data.tar.gztar -xzf data.tar.gz#remove the file if need disk spacerm -r data.tar.gzgaiad start
Here is finish the backup practice.
Congrats for being worry about having a backup file and be ready in case you need one because I can tell you from my experience that day is for sure around the corner someday and you are going to be proud for being prepared for that situation.
This backup file can be used for up a new node and sync the last block from the database, this file no contains private data of your server or accounts, it only contains the data of the blockchain, for that, you can compile it and make it public, shared with other, etc.
Please remember support my validator for the Cosmos hub meleatrust
Thanks for the support and for being part of this great Cosmos community
Looking for run a node Doker guide