{"record":{"id":"21a8db47139ab00a","repo":"phacility/phabricator","slug":"specify-namespace-to-rename-from-with-s","errorCode":null,"errorMessage":"Specify namespace to rename from with %s.","messagePattern":"Specify namespace to rename from with (.+?)\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php","lineNumber":71,"sourceCode":"  protected function isReadOnlyWorkflow() {\n    return true;\n  }\n\n  public function didExecute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $input = $args->getArg('input');\n    $is_live = $args->getArg('live');\n    if (!strlen($input) && !$is_live) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify the dumpfile to read with \"--input\", or use \"--live\" to '.\n          'generate one automatically.'));\n    }\n\n    $from = $args->getArg('from');\n    if (!strlen($from)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify namespace to rename from with %s.',\n          '--from'));\n    }\n\n    $to = $args->getArg('to');\n    if (!strlen($to)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify namespace to rename to with %s.',\n          '--to'));\n    }\n\n\n    $output_file = $args->getArg('output');\n    $is_overwrite = $args->getArg('overwrite');\n    $is_compress = $args->getArg('compress');\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php#L53-L89","documentation":"Thrown by `bin/storage renamespace` when `--from` is missing or empty. The rename works by regex-replacing the namespace prefix (the from value) inside USE and CREATE DATABASE lines of a dump, so the source namespace is mandatory. This is a PhutilArgumentUsageException: the command aborts before any dump is read.","triggerScenarios":"Invoking renamespace with `--to` (or neither namespace flag) but no `--from`, so strlen($from) == 0 at the check.","commonSituations":"Swapping --from/--to when adapting a prod-to-dev command; a wrapper script where the FROM variable is empty due to a typo or missing export; renaming to the same namespace and dropping one flag by mistake.","solutions":["Add `--from <namespace>` naming the prefix currently used in the dump (for example --from phabricator).","Verify the spelling against the dump itself: `grep 'USE ' dump.sql | head` shows the current database names.","Check that the wrapper script actually sets and exports the FROM variable."],"exampleFix":"# before\n./bin/storage renamespace --input dump.sql --to devns\n\n# after\n./bin/storage renamespace --input dump.sql --from phabricator --to devns","handlingStrategy":"validation","validationCode":"if [ -z \"$FROM\" ]; then\n  echo 'error: FROM namespace is required (--from)' >&2\n  exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set and export both FROM and TO in wrapper scripts; check them before invoking.","Confirm the current prefix with `grep 'USE ' dump.sql | head` before renaming."],"tags":["phabricator","bin-storage","renamespace","cli","argument-validation","missing-argument"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}