If the WP user ID and email are the same on your production and staging sites, you can switch over to using the production site without having to make any changes on the Discourse end.
It would be a good idea to double check to make sure that the user IDs are the same though. I seem to remember that with WP Engine staging and production sites there wasn’t a guarantee that the user IDs would match between production and staging - they use completely separate databases. Make sure that isn’t the case for your production and staging sites.
If you aren’t sure that the user IDs will match between production and staging, and the require_activation
parameter is not being set to true
in the SSO payload, you can safely delete all existing SingleSignOnRecord
entries from the Discourse database before switching over to the production site. The first time existing users login to Discourse via WordPress, Discourse will find them based on their email address and generate a new SingleSignOnRecord
for them.
Existing SingleSignOnRecord
entries can be deleted from the Rails console with:
SingleSignOnRecord.destroy_all
If the require_activation
parameter is being set to true
in the SSO payload, you can still delete the SSO records on the Discourse end. Before existing users can log into Discourse from your production site, you’ll need to mark their email addresses as verified on WordPress. Details about how to do that from their WordPress profile pages are here: Validate Email Addresses with the WP Discourse plugin.