I figured out pinned data is cached in blocks folder. Can I just get away with copying the files I need in blocks folder to backup? Is datastore folder generated automatically by ipfs daemon?
I tried copying only the blocks folder to another ipfs deamon and it recognized the .data files as pinned files and created a different datastore folder.
There are three stores used by Kubo (formerly go-ipfs):
These have folders in the
.ipfs
directory used by Kubo (with default configuration which uses leveldb for data store and flatfs for blockstore).datastore
folder: used by leveldb to store things like pins and MFS rootsblocks
folder where blocks are stored. This includes non-pinned blocks that are cached by your node.You could copy the
blocks
folder to another IPFS daemon with the same configuration. However, I'd be aware that it may not be the best way to do this, especially if the node is running and modifying the blocks folder.A much more explicit way would be to use the
ipfs dag export <CID>
command to export.car
files..car
files are convenient because they can be imported into another IPFS node and contain inside all the blocks.