exp:expurlimport
Import a URL map (CSV, JSON, .xlsx, .ods, Apache or nginx rules) into the URL translator, the wildcards and the redirects, as one batch that can be undone.
Script bin/php/expurlimport.php, code in kernel/private/classes/commands/expurlimport.php. Run it from the installation root, as the user the web server runs as:
./console exp:expurlimport --help
./console exp:url:import --help
php bin/php/expurlimport.php --helpHelp text
Import a URL map into the URL translator, the wildcards and the redirects
Reads the file (CSV, JSON, .xlsx, .ods, Apache or nginx rules; the format from its name or content,
or --format), plans every row (new, changed, unchanged, duplicate, conflict, broken target, unknown
host, not importable) and imports the new ones, and the changed ones with --on-conflict=overwrite, as
one batch: exp:url:undo <batch> takes it back. Bare paths belong to the siteaccess of -s (default the
default siteaccess); a full address's host picks the siteaccess, or --host maps an old host to one.
./console exp:url:import old-site.csv --dry-run --report=var/tmp/plan.csv
./console exp:url:import old-site.htaccess -s site --on-conflict=overwrite
./console exp:url:import map.xlsx --host=www.old-site.com=site --output-format=jsonOptions
| Option | Value | Help |
|---|---|---|
--format | required | import: the format of the file (csv, json, xlsx, ods, apache, nginx; default from its name or content); export: the format to write (default from --output, else csv); batches, undo, from-sitemap, from-404, suggest, test: text (default) or json (the machine output exp-url/1) |
--language | required | import: the language of rows without one (default the siteaccess's); export: only this language |
--on-conflict | required | What happens to an old address that has another entry already: skip (default) or overwrite |
--dry-run | Plan and check only: list what would be imported, write nothing | |
--report | required | import: also write the plan, row by row, to this file (.json, or .csv); suggest, test: also write every row with its suggestions or its result to this file (.json, or .csv) |
--host | required | An old host and the siteaccess it stands for, old-site.com=site (a comma list or repeated): for full addresses of a host that is not this installation's |
--login | required | Run as this user (recorded with the import and in the audit) |
--output-format | required | import, export: what the command prints, text (default) or json (the machine output exp-url/1); --format is the file's format there; from-sitemap, from-404, suggest: the format of the file written (csv, json, xlsx, ods, apache, nginx; default from --output, else csv) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [file].
Related
Generated by ./console exp:help:examples from bin/php/expurlimport.php, kernel/private/classes/commands/expurlimport.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.