What is the best way to move pinned IPFS files from one server to another?
I have one server that is running an IPFS node, I want that node’s IPFS files transferred to another IPFS node running on another server. What is the best way to do this?
What is the best way to move pinned IPFS files from one server to another?
I have one server that is running an IPFS node, I want that node’s IPFS files transferred to another IPFS node running on another server. What is the best way to do this?
The easy way is:
You can also copy your datastore or .ipfs
folder with your favorite file transfers method while both nodes are not running. (if you copy the whole .ipfs
don’t forget to rotate the key on your new server, if you don’t they will share the same peerID wich will creates bugs and likely render your node useless for sharing files.)
You could rsync the whole ipfs directory…
Is there a way to do it with IPFS Cluster? I’m concerned about just pinning the files on the new server because there are a lot of files and I’d need to write a script to do it, which is fine, but I just wonder if there is a better or “recommended” way.
If you have a cluster just pin the files on the cluster.
If a cluster tries to pin already pin file it will just think this was very quick and be happy.
I’m not sure of what is your question. Do you want a script that list all pins and then add them to ipfs cluster?
I’m not currently using cluster, but would be open to getting it if it helped. I can write the script, but I just was researching around to see if that is truly the best way. Thanks for the answers!
I think the best way depends of datasizes.
Ipfs is not fast (yet) so
tar -cf - ~/.ipfs | ssh ipfs@example.com tar -C ~ -xf -
(maybe add compression in the flow if bandwith is the bottleneck) and then rotate the key with ipfs key rotate
. As even if this add a step, this will be way much faster.Thanks! I’m fine if it is slow because this move is just a migration to another host that isn’t too time sensitive. But I’ll keep the other options in mind for future migrations.