exp:expurlfromsitemap
Start a URL map from an old site's sitemap (sitemap.xml, a sitemap index, .gz) or a crawl list: every old address as a row to fill in.
Script bin/php/expurlfromsitemap.php, code in kernel/private/classes/commands/expurlfromsitemap.php. Run it from the installation root, as the user the web server runs as:
./console exp:expurlfromsitemap --help
./console exp:url:from-sitemap --help
php bin/php/expurlfromsitemap.php --helpHelp text
Start a URL map from an old site's sitemap or a crawl list
Reads a sitemap (an address or a file): a <urlset>, a sitemap index with the sitemaps it names, either
gzip-compressed, or a crawl list with one address per line. Writes every old address once as a row
with an empty new_url, in any format exp:url:import reads: fill the targets in (exp:url:suggest helps),
then import. Only the addresses of the sitemap's own host are kept unless --only-host or --any-host.
./console exp:url:from-sitemap https://www.old-site.com/sitemap.xml --output=var/tmp/old-site.csv
./console exp:url:from-sitemap var/tmp/crawl.txt --limit=500 --output=var/tmp/old-site.xlsx
./console exp:url:from-sitemap https://www.old-site.com/sitemap_index.xml --any-host --format=jsonOptions
| Option | Value | Help |
|---|---|---|
--output | required | The file to write (default the standard output; needed for xlsx and ods) |
--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) |
--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) |
--limit | required | batches: how many of the last imports to list (default 20); from-sitemap, from-404, test: the most rows (default all) |
--only-host | required | from-sitemap: keep only the addresses of this host (a comma list or repeated; default the host of the sitemap address, or of its first address) |
--any-host | from-sitemap: keep the addresses of every host | |
--keep-duplicates | from-sitemap: keep an address listed more than once (default: once) | |
--full-urls | from-sitemap: write the old addresses with scheme and host (default: the path and query, as an import on this site needs them) | |
--timeout | required | from-sitemap, test: the seconds a request may take (default 15) |
--insecure | from-sitemap, test: do not verify TLS certificates (for test hosts with a self-signed one) |
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: [source].
Related
Generated by ./console exp:help:examples from bin/php/expurlfromsitemap.php, kernel/private/classes/commands/expurlfromsitemap.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.