Changing a site path or domain impacts WordPress, Apache, and SSL. Plan the order of operations and have a backup.
Prerequisites
- SSH access
- A backup (or snapshot) of files + database
- DNS ready (or planned cutover window)
Update URLs
Prefer WP-CLI:
wp search-replace 'old-url' 'new-url'
Update Apache vhost
Ensure docroot points to:
/var/www/<site-root>
Reload Apache after changes: fixing Apache restart failures if something fails.
High-risk SSL warning
Deleting certificates incorrectly can break multiple sites. Before changing anything:
sudo certbot certificates
If you use Cloudflare in front, align SSL mode and WordPress URLs to avoid redirect loops.
Related
- Full WordPress site migration (files + DB + config) on Ubuntu — end-to-end migration
- Migrating a WordPress database between servers — when the DB moves too
- Fixing redirect loops after WordPress migration or URL change — when redirects break
- Cloudflare SSL mode and WordPress redirect loops — URL and SSL alignment