{"record":{"id":"6ae9ed2a149d754c","repo":"phacility/phabricator","slug":"you-must-specify-a-path-prefix-to-move-from-with","errorCode":null,"errorMessage":"You must specify a path prefix to move from with --from.","messagePattern":"You must specify a path prefix to move from with --from\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php","lineNumber":42,"sourceCode":"            'help' => pht('Apply changes without prompting.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\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();","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/management/PhabricatorRepositoryManagementMovePathsWorkflow.php#L24-L60","documentation":"Thrown by `bin/repository move-paths` when the `--from` argument is missing or an empty string (`!strlen($from)`). The workflow batch-rewrites the `localPath` column for every repository whose local path starts with the prefix, so it refuses to guess the source prefix. Thrown as a plain `Exception` (not a usage exception).","triggerScenarios":"Running `./bin/repository move-paths --to /new/repo` and forgetting `--from`; passing `--from \"\"` from a script where the variable is empty; omitting both flags.","commonSituations":"Storage migrations after moving the repository root (`/repos` → `/srv/repos`); wrapper scripts with an unset `$FROM` shell variable.","solutions":["Supply the source prefix: `./bin/repository move-paths --from /old/repo --to /new/repo`.","In scripts, default the variables and assert non-empty before invoking.","Dry-run first without `--force` to review the table of rewrites it proposes."],"exampleFix":"// before\n$ ./bin/repository move-paths --to /srv/repos\n[1177] You must specify a path prefix to move from with --from.\n\n// after\n$ ./bin/repository move-paths --from /var/repos --to /srv/repos","handlingStrategy":"validation","validationCode":": \"${FROM:?--from prefix required}\"\n./bin/repository move-paths --from \"$FROM\" --to \"$TO\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert both FROM and TO are non-empty in automation (`: \"${FROM:?}\" \"${TO:?}\"`).","Run the command interactively once to see the preview table before scripting it."],"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"}