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!

1 Like

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

1 Like

@no1453
Thank you very much! These instructions ought to to be incorporated into desktop-ipfs.

Starting afresh :slight_smile:

to start afresh just delete the .ipfs directory

1 Like

That .ipfs directory is quite large and would take a lot of downloading.
Would it cause problems to cut/paste the old directory and then let it update from there?

I had to run init again to add the server option as I’m running on azure. When I ran init again it failed as it found the previous .ipfs directory. Documentation says to delete .ipfs if you want to run init again. If you have files that you want to save maybe you can edit your config. I don’t know how

1 Like

I have tried stopping IPFS, deleting the default .ipfs folder, setting the new path as described above and then restarting IPFS. The deleted folder reappears very shortly afterwards. The new folder isn’t used.

I don’t know why.

Perhaps the thing to do is uninstall everything IPFS related and start entirely from scratch…

On windows if you create a system environment variable you have to reboot. If it’s local you have to reopen CMD to get the updated environment. Type ‘set’ at CMD prompt to check if you have IPFS_PATH

1 Like

I stopped IPFS, uninstalled all the IPFS sotware and removed all IPFS browser extensions, deleted the .ipfs default folder and set the new, desired path for storing IPFS. After rebooting and installing the latest 0.9.2 ipfs-desktop, it launched and soon the undesired, default folder was created again. The desired folder remains unused.

At the CMD prompt, set shows that IPFS_PATH is set as desired.
IPFS-Desktop > Advanced > Open Repository Directory shows the undesired, default path.

At this stage, I am too embarrassed to continue trying to resolve the issue. Why the fuck don’t they make this setting available in the GUI?

Did you remember the last backslash?

Thanks for your perseverance! Yes, the specified path includes the final backslash.

D:\.ipfs\

Have you tried creating the directory first. BTW you have to do this at the CMD prompt
OR
try a directory name without a leading dot D:\ipfs\

Thanks. This situation seems to be solved now. The IPFS desktop client now allows you to specify an arbitrary path for the datastore. That and setting the system according to @no1453 says in this thread seems to have worked.