Attach a project without workspace.json

My colleague wants to attach an approximately 1.5 year-old backed-up project folder to a up-to-date CryoSPARC instance, but the project folder is missing the workspace.json file. The project is removed from the previous instance, so it is not possible to re-create the workspace.json file from the database as described here Workspace json missing

Is it possible to “force attach” a project folder?

Provided the missing workspaces.json is the only defect of the project directory, you may try the procedure outlined below.
Caution: The procedure described below

  1. is intended as a recovery procedure under narrow circumstances where no better alternative has been identified. It is not part of routine data management.
  2. has not been tested for potential downstream effects on the integrity of the project directory or
    future processing inside the project.
  3. does not restore CryoSPARC Live Sessions.

The procedure:

  1. Preserve a copy of the project directory for the case that the procedure corrupts the project directory.

  2. Estimate the workspaces needed with the command (replacing /path/to/project_dir as appropriate)

    find /path/to/project_dir -maxdepth 2 -name job.json -exec egrep -o '"W[0-9]+"' {} \; | sort | uniq
    
  3. Place inside the detached project directory that lacks the workspaces.json file a workspaces.json file with contents similar to this example where the project included workspaces W1 and W2:

    [
        {   
            "uid": "W1",
            "uid_num": 1,
            "title": "Untitled",
            "description": "A workspace stub to facilitate import of a damaged project.",
            "created_at": {
                "$date": "1970-01-01T00:00:00.000Z"
            },
            "created_by_job_uid": null,
            "workspace_type": "base",
            "deleted": false
        },
        {
            "uid": "W2",
            "uid_num": 2,
            "title": "Untitled",
            "description": "A workspace stub to facilitate import of a damaged project.",
            "created_at": {
                "$date": "1970-01-01T00:00:00.000Z"
            },
            "created_by_job_uid": null,
            "workspace_type": "base",
            "deleted": false
        }
    ]  
    

    Include one object block like

        {   
            "uid": "W1",
            "uid_num": 1,
            "title": "Untitled",
            "description": "A workspace stub to facilitate import of a damaged project.",
            "created_at": {
                "$date": "1970-01-01T00:00:00.000Z"
            },
            "created_by_job_uid": null,
            "workspace_type": "base",
            "deleted": false
        }
    

    with the correspondingly edited "uid" and "uid_num" values for each workspace uid identified in the previous step. All but the final workspace object block need to be followed by a comma , character.

  4. After attachment is complete, workspaces will be lacking some statistics that can be updated by pushing the indicated button

[edited 2025-03-28 to to include uid_num fields]