{"record":{"id":"178ead9c97e80bb2","repo":"phacility/phabricator","slug":"you-must-specify-a-path-prefix-to-move-to-with-t","errorCode":null,"errorMessage":"You must specify a path prefix to move to with --to.","messagePattern":"You must specify a path prefix to move to with --to\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php","lineNumber":49,"sourceCode":"\n    $repos = id(new PhabricatorRepositoryQuery())\n      ->setViewer($this->getViewer())\n      ->execute();\n    if (!$repos) {\n      $console->writeErr(\"%s\\n\", pht('There are no repositories.'));\n      return 0;\n    }\n\n    $from = $args->getArg('from');\n    if (!strlen($from)) {\n      throw new Exception(\n        pht(\n          'You must specify a path prefix to move from with --from.'));\n    }\n\n    $to = $args->getArg('to');\n    if (!strlen($to)) {\n      throw new Exception(\n        pht(\n          'You must specify a path prefix to move to with --to.'));\n    }\n\n    $is_force = $args->getArg('force');\n\n    $rows = array();\n\n    $any_changes = false;\n    foreach ($repos as $repo) {\n      $src = $repo->getLocalPath();\n\n      $row = array(\n        'repository' => $repo,\n        'move' => false,\n        'monogram' => $repo->getMonogram(),\n        'src' => $src,\n        'dst' => '',","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php#L31-L67","documentation":"Thrown by `bin/repository move-paths` when `--to` is missing or empty (`!strlen($to)`), the counterpart of the `--from` check. The workflow rewrites repository `localPath` values from the old prefix to the new prefix (via `UPDATE ... SET localPath = %s`), so both ends of the mapping must be provided.","triggerScenarios":"Running `./bin/repository move-paths --from /old/repo` without `--to`; `--to \"$TO\"` in a script where TO is unset.","commonSituations":"Half-written migration commands after reorganizing storage; scripts that compute the destination with a failed command substitution, yielding an empty string.","solutions":["Supply the destination prefix: `./bin/repository move-paths --from /old --to /new`.","Assert both variables are non-empty in automation: `: \"${FROM:?}\" \"${TO:?}\"`.","Review the proposed rewrites in the confirmation table before confirming."],"exampleFix":"// before\n$ ./bin/repository move-paths --from /var/repos\n[1178] You must specify a path prefix to move to with --to.\n\n// after\n$ ./bin/repository move-paths --from /var/repos --to /srv/repos","handlingStrategy":"validation","validationCode":": \"${TO:?--to prefix required}\"\n./bin/repository move-paths --from \"$FROM\" --to \"$TO\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set both prefixes via explicit variables and fail fast when either is empty.","Verify the destination directory exists and Phabricator's user can write it before rewriting localPath."],"tags":["phabricator","phorge","cli","usage-error","missing-flag","paths","migration"],"backgroundTag":"missing-required-flag","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}