Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: peppe on October 09, 2013, 01:05:08 PM

Title: Move all users to a new groupTh
Post by: peppe on October 09, 2013, 01:05:08 PM
Hi.

I've a 1.1.18 SMF board with around 2500 registered users.

Now I want that all registered users will come to a new user group that I will create.


How can I do it without modifying their profile one by one??


Thank you very much for your reply! :)
Title: Re: Move all users to a new groupTh
Post by: margarett on October 09, 2013, 01:08:14 PM
How many primary membergroups do you have? Don't some of those users have a membergroup assigned already (other than post count groups)?
Title: Re: Move all users to a new groupTh
Post by: Kindred on October 09, 2013, 01:59:53 PM
the only realistic way to do this would be to use a direct SQL edit...
Title: Re: Move all users to a new groupTh
Post by: margarett on October 09, 2013, 02:19:19 PM
Yup, that's why I was trying to understand what is the actual "state of things".
Title: Re: Move all users to a new groupTh
Post by: Arantor on October 09, 2013, 02:20:47 PM
I don't get why there is a need to move anyone, if it's permissions, use Registered Members or post count groups, if it's anything else it's likely for display purposes only.

In any case I wouldn't be too concerned about 1.1.x, I'd be more concerned about planning an upgrade since 1.1.x will not be supported forever.
Title: Re: Move all users to a new groupTh
Post by: Kindred on October 09, 2013, 02:21:32 PM
well... for new users going forward
http://custom.simplemachines.org/mods/index.php?mod=819
Title: Re: Move all users to a new groupTh
Post by: peppe on October 10, 2013, 02:34:26 AM
All my users are in one group, registered members by default.
Title: Re: Move all users to a new groupTh
Post by: margarett on October 10, 2013, 02:47:08 AM
That's not entirely true. You and other administrators are in a different group :)

I'm not on the computer and I don't remember the database schema for 1.1.x but you are looking at something like:
UPDATE smf_members
SET id_group = 99
WHERE id_group =0

Now... You need to check both the table and column names because I'm not on the computer...

Oh, and of course you'll backup first, right? ;)
Title: Re: Move all users to a new groupTh
Post by: peppe on October 10, 2013, 08:23:32 AM
It works!!!!! Thank you very much!! :)
Title: Re: Move all users to a new groupTh
Post by: Arantor on October 10, 2013, 11:01:31 AM
@margarett Just FYI, the schema on this subject is basically unchanged. The only difference is that the column is capitalised in 1.1, being ID_GROUP to signify it is a foreign key (as key constraints aren't actually used in the code), but MySQL isn't case sensitive.

On a related note, additional_groups in 2.0 is additionalGroups in 1.1 if that's needed here.
Title: Re: Move all users to a new groupTh
Post by: margarett on October 10, 2013, 11:10:00 AM
Ty ;)