Change WordPress user roles and capabilities › Forums › How to or FAQ › Migration of plugin and user roles on from a test to live site.
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by Vladimir.
-
AuthorPosts
-
10/03/2020 at 09:47 #6686alicornParticipant
Hi Vladimir,
Just wanted to ask if it is possible to migrate all my user-roles from my test to live site. My plugin is currently activated only on my test site, and I would like to move everything over to the live site without going trough multiple user-roles again.
I’ve tried searching but did not find anything. Any kind of help would be appreciated!
Kind regards,
Andrija
10/03/2020 at 12:23 #6688VladimirKeymasterHi Andrija,
If you have not too much user roles you can use ‘Export/Import’ buttons to make this role by role. ‘Export’ button write currently selected role to the local file. ‘Import’ button imports role data from the selected file (previously exported).
This will resolve your task if you don’t care about data set for/by URE additional modules.
10/03/2020 at 14:15 #6693alicornParticipantHi Vladimir,
Thanks for the info. I have a lot of users, but I did get most if not all the permissions sorted through roles. So this will definitely save me some time. I would basically need to make sure all my settings are the same first, then export -> import the roles across the two sites, and finish everything up by assigning the users the appropriate roles.
Kind regards,
Andrija
11/03/2020 at 01:54 #6695VladimirKeymasterIf you familiar with SQL and the tools like phpMyAdmin, it’s possible to export/import all user roles with less efforts. Suppose the database prefix is ‘wp_’.
1) Find the WordPress db record with user roles:SELECT * FROM wp_options WHERE option_name='wp_user_roles';
2) Update all user roles at once:
UPDATE wp_options SET option_value='changed value here' WHERE option_id=NN LIMIT 1;
This post explains in details how and where WordPress stores user roles data.
Do you use any URE Pro additional modules at the test site?
11/03/2020 at 09:59 #6696alicornParticipantHi Vladimir,
Sorry for getting back to you so late. But yes, I do have some URE additional modules.
Namely:
Activate Administrator Menu Access module
Activate “Create” capability for posts/pages/custom post types
Activate user access management to editing selected posts, pages, custom post types
Force custom post types to use their own capabilitiesI’ll look at your post, as I’m familiar with SQL. Thanks for your help!
Best regards,
Andrija
11/03/2020 at 13:52 #6697VladimirKeymasterHi Andrija,
In this case this is may be interesting for you too:
1) Base options saved by User Role Editor Pro:SELECT * FROM wp_options WHERE option_name LIKE 'user_role_editor';
2) Data saved by URE add-ons:
SELECT * FROM wp_options WHERE option_name LIKE 'ure_%';
Before importing ure_posts_edit_access_data record to the live database take into account if posts/pages ID are the same at the source and targets databases.
-
AuthorPosts
- You must be logged in to reply to this topic.