Can project directories be renamed?

I have some project directories that were renamed rather than copied, so the original directories no longer exist. Based on the answer at Are project directories moveable?, I’ve tried running a command of the form: cryosparcm cli "update_project_directory('P55', '/bulk/data/cryosparc_projects/P55')"

but it looks for the old path and gives an error like:

ServerError: validation error: lock file for P55 at /bulk/OLD-data/cryosparc_projects/P55/cs.lock absent or otherwise inaccessible. 
Traceback (most recent call last):
  File "/master-dir/cryosparc_master/cryosparc_command/commandcommon.py", line 196, in wrapper
    res = func(*args, **kwargs)
  File "/master-dir/cryosparc_master/cryosparc_command/commandcommon.py", line 250, in wrapper
    assert os.path.isfile(
AssertionError: validation error: lock file for P55 at /bulk/OLD-data/cryosparc_projects/P55/cs.lock absent or otherwise inaccessible.

Is there a way to update the project directories in the database so that these projects can still be used?

@mil (The update_project() cli function has a different purpose.) You may be able to recover from this particular validation error by a sequence of command line and GUI actions:

  1. Run the following command
    cryosparcm mongo # access the database shell
    db.projects.updateOne({uid: "P55"}, {$set: {archived: true}})
    exit
    
    After running the command, the project may disappear from view. Show the project by enabling the Show Archived filter.
  2. Then Unarchive the project, which will prompt you for the new path of the project directory.
    The project may again disappear from view. To make it visible again, remove the Show Archived filter.
    image

The proper procedure for changes to the project directory path is to

  1. Complete the Archive Project action before changing the path.
  2. Change the path of the project directory.
  3. Unarchive the project, specifying the project directory’s new path.

@wtempel Thanks for this information! The procedure you provided worked to recover our projects.