Moving Datacache

Hello IPFSies!

I have had a surprisingly difficult time trying to move the datacache from its currently location on my SSD at ~/.ipfs to a large spinning media disk. I haven’t been able to find any clear documentation on how to do this… I’m assuming that I can just edit the config file. But when I execute “ipfs config edit”, I get ENV variable $EDITOR not set`. So

  1. Can I install ipfs in a way that sets up the cache where I want it the first time?
  2. How do I move a cache after it is installed?
  3. How do I fix the ENV variable $EDITOR not set` problem so that ipfs config edit works.

I’m running on go-ipfs on Ubuntu 16.04

Thanks

If by datacache you mean datastore then the following should help:

From the command ipfs init --help:

ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
environment variable:
export IPFS_PATH=/path/to/ipfsrepo

So, before you run ipfs init, you must first set IPFS_PATH to the path of your larger disk.

The error: ENV variable $EDITOR not set is caused by not setting the EDITOR environment variable.
You can fix this by setting it to your preferred editor:
export EDITOR=vim
Verify it was set:
echo $EDITOR
See all your env variables (including IPFS_PATH):
printenv

While the IPFS_PATH method is probably the recommended route, I do this on linux and windows using symbolic links.

On linux the command to create a symbolic link would be something like

ln -s /path/to/ipfs/directory/on/large/drive /home/user/.ipfs