Change file path in DB after data migration


we had a major update on our file system which caused some user folders to be renamed.
The projects can not be accessed by cryosparc, I tried to change paths in the DB according to this, however the non-existing lock file in the original directory (which doesn’t exist any longer) is causing issues.
Any suggestions how to overcome that besides re-attaching?


Hi @tarek . Is cs.lock present in the project directory, even if that directory is now mounted under a new path?

Yes, it exists in the new directory.

To regenerate the cs.lock, do this:

#login to the master and change dir to the project dir
cryosparcm cli "get_config_var('instance_uid')">cs.lock

The first line of the cs.lock file should contain the instance_uid of the installation.

Thanks for your reply. Unfortunately, the old project dir doesn’t exist and can not be restored.
All data was moved to a new dir.

Hi @tarek.

applies to CryoSPARC v<4. I do not know whether your attempt at running the command shown at that link on a v4 instance would result in an update of the project_dir record. If the project_dir record was not updated and is still out-of-sync with the “reality” on the filesystem, you may try:

  1. backup your database, just in case…
  2. update the project directory path database record for hypothetical project P999 to /new/path/of/project_dir
    cryosparcm icli # enter the interactive cli
    db.projects.update_one({'uid': 'P999'}, {'$set': {'project_dir': '/new/path/of/project_dir'}})

Does this help?

1 Like

That helped! Many thanks @wtempel