I have used discourse script and migrated phpbb data to discourse, now i have moved my site to WordPress and I need to migrate some user data, I have made custom user fields in discourse, and used this hook “wpdc_sso_params” to migrate custom fields data.
but problem is it sync data when user logged in, if some user not logged in again or expired users data will not migrate in this way.
is there any hook or script that can migrate all users data at once.
other thing is like we are mapping custom fields, how can I map full name and first and last name fields? like we can set custom avatar using “wpdc_sso_avatar_url” this hook.
If the WP Discourse plugin is activated on your WordPress site, you can write a script that loops through all your site’s users and calls the sync_sso_record function with the SSO params for each user you want to update:
It is a static function, so you need to call it with:
It has been a while since I tried to do this. Test it with one user before trying to loop through all users on the site.
You could use the Discourse external_name field for the full name. The name you set with the external_name field will become the user’s Name on Discourse. If you need separate first and last name fields, you will have to create custom fields for them on Discourse.
Let me know if you run into any trouble with this. I can try to test it out tomorrow.
Everyone here does their best to help solve problems. Simon’s helping you and is automatically notified of replies unless he disabled the notifications.
So, there is no need to @mention him and bump a topic, especially after waiting less than 3 hours only. Please be patient in this regard
Sorry about the error in the code I supplied. I was reading the plugin’s code wrong. The way you are calling the function is correct. This should also work: