Skip to content

Migrating Websites

Say you move your website from one domain to another. How do you know if you missed to migrate any old links? 🤔

You can check that with lychee!

Here’s how to check all the links in your sitemap after migrating your website from to

Terminal window
lychee --remap '' --

The --remap option takes a list of space-separated pairs of strings. The first string is the old URL pattern and the second string is the new URL pattern. In this example, the old domain is replaced with the new domain in all links.

You can use this option multiple times to remap multiple domains and you can use regular expressions.

You can also check the migration on a local dev version of your website:

Terminal window
lychee --remap ' localhost:8000' ...

Of course you can also combine this with other lychee features. In the below example we limit the number of concurrent requests to 4 to not overload the server.

Terminal window
lychee --remap '' \
--exclude '' \
--exclude '' \
--verbose \
--no-progress \
--max-concurrency 4 \

Remap is a powerful feature. Instead of just replacing domains, you can also use regular expressions to replace parts of the URL.

For example, if you want to migrate from GitHub to GitLab, you can use this command:

Terminal window
lychee --remap '*)$1' ...

This will replace all links from to while keeping the rest of the URL intact.

You can also use named capture groups to replace parts of the URL with a different name:

Terminal window
lychee --remap '<org>.*)/(?P<repo>.*)$org/$repo' ...

For more information about the --remap option, see #620, #1129, and the example config file.