Recovery after failed move of .ipfs on Desktop

If you are comfortable with command-line, you could set IPFS_PATH to point at specific repository on your disk and migrate your data that way.

Below are commands from Linux, most likely you’d have to tweak them to work on Windows.

Import/export .car file with all the data

CAR import/export is quite flexible, as it can be performed when your nodes are online or offline.

  1. Export all “Files” from your old node to a .car file:
$ export IPFS_PATH=/path/to/OLD/.ipfs
$ ipfs files stat / 
(the first line will have root CID with all your "Files")

$ ipfs dag export CID >  files.car
  1. Then on the new repo/node import the .car and put everything under /old-files directory in “Files” :
$ export IPFS_PATH=/path/to/NEW/.ipfs
$ ipfs dag import files.car
$ ipfs files cp /ipfs/CID /old-files-dir
$ ipfs pin rm CID 

( remove low level pin at the end because MFS aka “Files” will already protect data from GC, and you most likely don’t want the data removed from “Files” to be stuck in your cache)

Streaming CAR without touching the disk

Alternatively, if you have two nodes running you could use ipfs --api to point at specific ones, and even pipe the data so there is no .car written to the disk.

For example, to migrate everything from Brave to IPFS Desktop (assuming default RPC API ports:

$ ipfs --api /ip4/127.0.0.1/tcp/45001 dag export CID |  ipfs --api /ip4/127.0.0.1/tcp/5001 dag import 
$ ipfs --api /ip4/127.0.0.1/tcp/5001  files cp /ipfs/CID /old-files-dir
$ ipfs --api /ip4/127.0.0.1/tcp/5001  pin rm CID