phacility/phabricator · warning · PhutilArgumentUsageException
Specify namespace to rename to with %s.
Error message
Specify namespace to rename to with %s.
What it means
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.
Source
Thrown at src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php:79
$is_live = $args->getArg('live');
if (!strlen($input) && !$is_live) {
throw new PhutilArgumentUsageException(
pht(
'Specify the dumpfile to read with "--input", or use "--live" to '.
'generate one automatically.'));
}
$from = $args->getArg('from');
if (!strlen($from)) {
throw new PhutilArgumentUsageException(
pht(
'Specify namespace to rename from with %s.',
'--from'));
}
$to = $args->getArg('to');
if (!strlen($to)) {
throw new PhutilArgumentUsageException(
pht(
'Specify namespace to rename to with %s.',
'--to'));
}
$output_file = $args->getArg('output');
$is_overwrite = $args->getArg('overwrite');
$is_compress = $args->getArg('compress');
if ($is_overwrite) {
if ($output_file === null) {
throw new PhutilArgumentUsageException(
pht(
'The "--overwrite" flag can only be used alongside "--output".'));
}
}
View on GitHub (pinned to 5720a38cfe)
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.
Example fix
# before ./bin/storage renamespace --input dump.sql --from phabricator # after ./bin/storage renamespace --input dump.sql --from phabricator --to staging
Defensive patterns
Strategy: validation
Validate before calling
if [ -z "$TO" ]; then echo 'error: TO namespace is required (--to)' >&2 exit 2 fi
Prevention
- 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.
When it happens
Trigger: Invoking renamespace with `--from` (or neither namespace flag) but no `--to`, so strlen($to) == 0 at the check.
Common situations: 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.
Related errors
- Specify namespace to rename from with %s.
- Specify the dumpfile to read with "--input", or use "--live"
- The "--overwrite" flag can only be used alongside "--output"
- Output file "%s" already exists. Use "--overwrite" to overwr
- Request parameter "%s" is not formatted properly. Expected a
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/14dbbaedf4dec86c.
Report an issue: GitHub.