Development to production, how to move a development site from http + dev.example.com to a production site https + example.com?

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.

  1. 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 SettingsGeneral screen. Having them in wp-config.php also ensures they’re instantly and correctly setup at deploy time.

  1. Copy over your database (I do this via the mysql command line utility).
  2. Copy over all files in your wp-content folder (including uploads).
  3. 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.