{"record":{"id":"c6e151403cdf95fd","repo":"n8n-io/n8n","slug":"can-t-migrate-workflows-and-credentials-to-the-pro","errorCode":null,"errorMessage":"Can't migrate workflows and credentials to the project with the ID ${flags.projectId}. That project is a personal project belonging to a user that was created via LDAP and will be deleted as well.","messagePattern":"Can't migrate workflows and credentials to the project with the ID (.+?)\\. That project is a personal project belonging to a user that was created via LDAP and will be deleted as well\\.","errorType":"exception","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/ldap/reset.ts","lineNumber":91,"sourceCode":"\t\tconst owner = await this.getOwner();\n\t\tconst ldapIdentities = await Container.get(AuthIdentityRepository).find({\n\t\t\twhere: { providerType: 'ldap' },\n\t\t\tselect: ['userId'],\n\t\t});\n\t\tconst personalProjectIds = await Container.get(\n\t\t\tProjectRelationRepository,\n\t\t).getPersonalProjectsForUsers(ldapIdentities.map((i) => i.userId));\n\n\t\t// Migrate all workflows and credentials to another project.\n\t\tif (flags.projectId ?? flags.userId) {\n\t\t\tif (flags.userId && ldapIdentities.some((i) => i.userId === flags.userId)) {\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t`Can't migrate workflows and credentials to the user with the ID ${flags.userId}. That user was created via LDAP and will be deleted as well.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (flags.projectId && personalProjectIds.includes(flags.projectId)) {\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t`Can't migrate workflows and credentials to the project with the ID ${flags.projectId}. That project is a personal project belonging to a user that was created via LDAP and will be deleted as well.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst project = await this.getProject(flags.userId, flags.projectId);\n\n\t\t\tawait Container.get(OwnershipTransferService).transferAllResources(\n\t\t\t\tpersonalProjectIds,\n\t\t\t\tproject.id,\n\t\t\t);\n\t\t}\n\n\t\tconst [ownedSharedWorkflows, ownedSharedCredentials] = await Promise.all([\n\t\t\tContainer.get(SharedWorkflowRepository).find({\n\t\t\t\tselect: { workflowId: true },\n\t\t\t\twhere: { projectId: In(personalProjectIds), role: 'workflow:owner' },\n\t\t\t}),\n\t\t\tContainer.get(SharedCredentialsRepository).find({","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/cli/src/commands/ldap/reset.ts#L73-L109","documentation":"Thrown by `ldap:reset` when `--projectId` resolves to a personal project belonging to an LDAP-created user. Since LDAP users are deleted in the same run, their personal projects are also removed, so migrating resources there would orphan them. Detected by checking the project ID against `personalProjectIds` returned from `ProjectRelationRepository.getPersonalProjectsForUsers`.","triggerScenarios":"Passing `--projectId` whose ID is the personal project of an LDAP user; passing a project ID copied from a user's profile page that turns out to be their personal workspace.","commonSituations":"Operator assumes a project ID is a shared team project when it is actually a personal one; LDAP-only tenancies where every project is a personal project.","solutions":["Target an existing shared/team project instead of a personal project.","Create a new shared project and pass its ID via `--projectId`.","Fall back to `--userId` pointing at a local (non-LDAP) user, or use `--deleteWorkflowsAndCredentials`."],"exampleFix":"// before\nn8n ldap:reset --projectId=<personal-project-of-ldap-user>\n// after\nn8n ldap:reset --projectId=<shared-team-project-id>","handlingStrategy":"validation","validationCode":"const personalProjectIds = await projectRelationRepo.getPersonalProjectsForUsers(ldapUserIds);\nif (personalProjectIds.includes(targetProjectId)) {\n  throw new Error('Target project is a personal project of an LDAP user and will be deleted; pick a shared project.');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Target shared/team projects only; never personal project IDs.","Keep a known-good shared project ID in your operations runbook."],"tags":["cli","ldap","ownership-transfer","user-error"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}