Migration From Retour
This plugin can run alongside Retour as long as Retour is disabled. This lets you migrate your data and test everything before committing to the switch.
- Install and enable 404 Redirects
- Run the database migration via console command (recommended) or CSV import (see below)
- Review the migrated data in the control panel
- Disable Retour
- Run 404 Redirects for a while and verify everything works as expected
- When you're happy, uninstall Retour
Database Migration via Console Command (recommended)
If Retour is still installed alongside 404 Redirects, run the migration console command to import directly from Retour's database tables. This is the most complete migration path, importing 404 stats, referrers, hit counts, redirect rules, status codes, and priorities.
php craft not-found-redirects/migrate/retourYou can also migrate 404s and redirects separately:
php craft not-found-redirects/migrate/retour-404sphp craft not-found-redirects/migrate/retour-redirectsWARNING
Retour's database tables must still exist when running the migration. Uninstall Retour after you've verified the data.
The migration:
- Imports 404 stats from
retour_statsincluding hit counts and referrers - Imports static redirect rules from
retour_static_redirectswith status codes and priorities - Skips records that already exist (matched by URI), safe to run multiple times
CSV Import via Control Panel (across environments)
Use CSV import when migrating data between environments, for example exporting from a production Retour install and importing into a local or staging site running 404 Redirects.
Limited compared to console command
CSV import does not capture all data that the console command migration does. If both plugins are on the same server, prefer the console command above.
First export your data from Retour's control panel (redirects and/or 404 statistics) and transfer the CSV files to the target environment.
Using the Console
php craft not-found-redirects/redirects/importArguments
path: string- Path to the Retour CSV export file.
Options
--source: native|retour- Import source format. Auto-detected from column headers if omitted.
php craft not-found-redirects/not-found-uris/importArguments
path: string- Path to the Retour CSV export file.
Options
--source: native|retour- Import source format. Auto-detected from column headers if omitted.
Using the Control Panel
Import via the control panel: go to Redirects → Import or 404s → Import and select "Retour" as the source format.