ipfs/fs-repo-migrations

fs-repo-migrations takes no argument or envvar for IFPS_PATH and only looks in $HOME/.ipfs

lordcirth opened this issue · 3 comments

When trying to upgrade from go-ipfs 0.4.23 to 0.6.0 on NixOS, where IFPS_PATH is /var/lib/ipfs by default, running fs-repo-migrations fails:

[lordcirth@atlas:/var/lib/ipfs]$ sudo -u ipfs fs-repo-migrations
ipfs migration:  stat /var/lib/ipfs/.ipfs: no such file or directory

Not surprising, but fs-repo-migrations --help shows nothing about changing this path; giving it as an argument is ignored, and setting IPFS_PATH does nothing either. I ended up running:

[lordcirth@atlas:/var/lib/ipfs]$ sudo ln -s . .ipfs

to work around this issue, which is a bit ugly.

djdv commented

giving it as an argument is ignored

For what it's worth, I run the migrations via the utilities in the subdirectories (fs-repo-migrations/ipfs-8-to-9, etc.) Which not only allow this, but require it.

dd@_:~/go/src/github.com/ipfs/fs-repo-migrations/ipfs-8-to-9$ ./main
Usage of ./main:
  -f    whether to force a migration (ignores warnings)
  -help
        display help message
  -no-revert
        do not attempt to automatically revert on failure
  -path string
        file path to migrate for fs based migrations (required)
  -revert
        whether to apply the migration backwards
  -verbose
        enable verbose logging
error: missing or empty path; flag '-path <ipfs_path>' is required

fs-repo-migrations does look at IPFS_PATH so I'm not sure what's going on here. Are you sure something else isn't resetting IPFS_PATH (e.g., some NixOS translation)?

Thanks, it looks like this was my fault. I just tested it again today and it worked, so I must have made some simple mistake.