{"record":{"id":"14dbbaedf4dec86c","repo":"phacility/phabricator","slug":"specify-namespace-to-rename-to-with-s","errorCode":null,"errorMessage":"Specify namespace to rename to with %s.","messagePattern":"Specify namespace to rename to with (.+?)\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php","lineNumber":79,"sourceCode":"    $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\n    if ($is_overwrite) {\n      if ($output_file === null) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'The \"--overwrite\" flag can only be used alongside \"--output\".'));\n      }\n    }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php#L61-L97","documentation":"Thrown by `bin/storage renamespace` when `--to` is missing or empty. The target namespace is the new prefix written into USE and CREATE DATABASE statements of the output dump, so it is mandatory. This is a PhutilArgumentUsageException: the command aborts before any dump is read.","triggerScenarios":"Invoking renamespace with `--from` (or neither namespace flag) but no `--to`, so strlen($to) == 0 at the check.","commonSituations":"Half-edited commands where only one namespace flag survived; wrapper scripts with an empty TO variable; deciding the target namespace mid-migration and dropping the flag temporarily.","solutions":["Add `--to <namespace>` naming the new prefix (for example --to staging).","Choose a namespace that matches the target install configuration so the restored dump lands in the right databases.","Check that the wrapper script sets the TO variable."],"exampleFix":"# before\n./bin/storage renamespace --input dump.sql --from phabricator\n\n# after\n./bin/storage renamespace --input dump.sql --from phabricator --to staging","handlingStrategy":"validation","validationCode":"if [ -z \"$TO\" ]; then\n  echo 'error: TO namespace is required (--to)' >&2\n  exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set and export both FROM and TO in wrapper scripts; check them before invoking.","Derive TO from the target install configuration so the restored dump lands correctly."],"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"}