Windows IPFS: Can you move the datastore off the system drive?

In my searches I’ve found ipfs repo stat will tell me, among other things, that my repo’s path is a folder called .ipfs in my Windows User Directory [C:\Users{my username}.]
Can this be repo path be changed to another drive on the computer? Space considerations are key here, for me, I don’t want all stored files on my system drive.
Google has been little help, I tried out versions of ipfs {command} --help, and just found the command showing it’s location. I’ve checked through the ipfs node config file, nothing there seems appropriate.
Can this even be done? Thanks for any insights.

Just answer my own question, under ipfs init --help the information says:

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
1 Like

That’s the official way to do it.

Symbolically linking the default directory to somewhere else also works.

Thanks for this explanation, but how do you set the variable in that way? Do you do it from the command line somehow or do you paste that line in somewhere? Where would you find that file that needs the extra line or editing?

On windows, open up the “System” control panel, click on “Advanced System Settings” on the list on the left, and the new window (“System Properties”) has a button to push labeled “Environment Variables”. (Under the “Advanced” tab, if it’s not already on it.)
You click that, then on the new window, in the second section (“System Variables”) click new.
Enter IPFS_PATH for the Variable Name, and the path you want to your ipfs repo goes in the Variable value. Mine is G:\.ipfs\. The trailing backslash in the address may be necessary, I had problems without it.

So click ok on all the windows, close them up. You’ve just created an “Environment Variable” on Windows.

A note: do this before you install or init ipfs and reboot before installing ipfs, is my suggestion. I experimented with methods to move the repo, I only had problems, but starting fresh works, I know.

That’s for windows. If you have some other system, my apologies!

ON linux, you enter export IPFS_PATH=/path/to/ipfsrepo on the command line.