5.2Migration & hosting change
The essentials in 30 seconds
- Migrating = moving files + database; plugins such as Duplicator or All-in-One WP Migration automate the operation.
- The critical point is replacing the URLs (old domain → new) and DNS propagation.
- Always back up first, then check the whole site afterwards: pages, links, forms, shop and emails.
Running mini-case — leaving a slow host
The workshop's site slows down and the host offers no staging. Samir prepares a migration to a more suitable host: full backup, export with Duplicator, import on the new server, checking URLs and links. He keeps the old site online until the DNS switch, then monitors errors for 48 hours.
Sequel to case 5.1 — maintaining also means knowing how to move.
1. Export, import, switch over
A migration moves two things: the files (theme, plugins, media) and the database (content, settings, users). Plugins such as Duplicator or All-in-One WP Migration package everything into an archive and deploy it to the new destination. It is also the method for putting a locally built site online.
Samir prepares the new destination (hosting, database, domain), imports the archive, then checks URL replacement. He tests pages, menus, forms and the shop. The old site stays online until the switch: that is the safety net.
2. DNS, domain and SEO
DNS points the domain to the new server; propagation can take from a few minutes to a few hours. Samir warns the client and monitors. If the domain changes, he sets up 301 redirects from the old to the new one to preserve search rankings and inbound links.
After migration, he checks emails, HTTPS certificates, backups and performance. A "half-migrated" site — broken images, silent forms, old URLs — costs more than a prepared migration.
🔎 Concrete example — Migrating the workshop to a new host (Samir's case)
Old: host A, domain atelier-bahja.ma.
New: host B, same domain.
1. Backup + Duplicator export.
2. Import to B, database created.
3. URLs checked, HTTPS active.
4. DNS switched in the evening, TTL lowered the day before.
5. Tests: pages, form, shop, emails.
→ Old site kept for 7 days.
Result: a migrated site with no visible downtime.
Lesson: lowering the TTL and keeping the old site limits the risks.
Section vocabulary
- Migration
- Moving a site (files + database) to another host or domain.
Simple example: moving from host A to host B.
What it is not: copying only the files without the database.
Reflex: files + database = a complete migration.
- Duplicator / All-in-One
- Plugins that package and restore a complete site.
Simple example: export as a single archive.
What it is not: migrating by hand without a backup.
Reflex: a dedicated export/import tool.
- URL replacement
- Correcting old addresses to the new domain in the database.
Simple example: old-domain.ma → new-domain.ma.
What it is not: leaving links to the old site.
Reflex: check the URLs after import.
- DNS
- The system that maps a domain to a server address.
Simple example: switching to the new host.
What it is not: changing server without touching DNS.
Reflex: DNS = the domain's routing.
- 301 redirect
- A permanent redirect from an old URL to the new one, useful for SEO.
Simple example: old-domain.ma → new.
What it is not: changing domain without a redirect.
Reflex: 301 to preserve search rankings.
In practice — Preparing a clean migration
- Back up the whole site and export it with a migration plugin.
- Prepare the destination (hosting, database, domain).
- Import, check URL replacement and test the key pages.
- Switch the DNS, check HTTPS and emails, keep the old site for a few days.
Ready-to-use script — reassuring about the migration (25s)
"We are going to move the site to a faster host, without losing content or search rankings. I back everything up, I test on the new server before the switch, and I keep the old site online for a few days as a precaution."
Emphasise the safety net: the old site kept and a backup.
Copy-paste template — migration plan
SOURCE: _______________
DESTINATION: _______________
BACKUP / EXPORT: _______________
URLS REPLACED: yes / no
HTTPS ACTIVE: yes / no
DNS SWITCHED: date _______________
POST-MIGRATION TESTS: pages / forms / shop / emails
OLD SITE KEPT UNTIL: _______________
Hosting change
Same domain, new server: migration + DNS.
Domain change
Migration + 301 redirects from the old domain.
Local to production
Local export, import to the host, URLs and HTTPS.
Large site
Manual FTP + SQL migration or the host's service.
✓ Best practices
- Back up and export before anything else.
- Lower the DNS TTL before the switch.
- Check URLs, HTTPS, forms and emails afterwards.
✗ Common pitfalls
- Migrating without a backup.
- Forgetting URL replacement.
- Shutting down the old site too early.
Key takeaways
- A migration moves files and the database.
- Plugins automate export/import.
- URL replacement and DNS are critical.
- Everything is checked afterwards and a rollback is kept.
48h Challenge — apply tomorrow
Export a test site with Duplicator, import it into a second environment and check the URLs, pages and forms. 40 minutes.
- I prepare and carry out a complete migration.
- I check URLs and redirects.
- I secure the DNS switch and the rollback.
Frequently asked questions
My site is too big for the free export: what should I do?
Use the paid version, Duplicator (less limited), a manual FTP + SQL export, or the migration service often offered by serious hosts. Many will migrate for you free of charge.
Will I lose my search rankings by migrating?
Not if the URLs stay identical and the migration is clean. If the domain changes, set up 301 redirects from the old to the new one to preserve the rankings already earned.
How long is the site unavailable?
With a prepared migration, downtime is often nil or very short: the old site stays online until the DNS switch. Propagation can take from a few minutes to a few hours depending on the TTL.
What is the most critical point of a WordPress migration?