I’ll try to outline the fundamental steps — your mileage might vary, depending on your actual setup. I tend to manage WordPress deployments in an automated manner (e.g. Ansible), so I have a preference for command-line scripts and config files.
- Define the home and site url in the
wp-config.php
file of your production environment (the one on HTTPS):
define( 'WP_HOME', 'https://example.com/' );
define( 'WP_SITEURL', 'https://example.com/' );
These have precedence over the corresponding settings (WordPress Address (URL) and Site Address (URL)) in your Settings → General screen. Having them in wp-config.php
also ensures they’re instantly and correctly setup at deploy time.
- Copy over your database (I do this via the mysql command line utility).
- Copy over all files in your
wp-content
folder (including uploads). - Use WP CLI to search and replace URLs across the whole database:
wp search-replace 'http://example.com' 'https://example.com'
That’s basically it for WordPress itself. Finally just make sure your web server is redirecting all traffic from http to https.