Mass delete of users

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
User avatar
chanlon1
Registered User
Posts: 228
Joined: Wed Mar 09, 2005 10:01 pm
Location: Belfast, N. Ireland
Contact:

Mass delete of users

Post by chanlon1 »

I have a copy of a copy of a backup that has thousands of users and posts.
I want to remove and delete all users, but leave their posts.
What’s the easiest way to mass delete users?

Thanks
User avatar
halil16
Registered User
Posts: 1281
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil
Contact:

Re: Mass delete of users

Post by halil16 »

Users and Groups > Users > Trimming Users

You can do whatever you want by going to this page where you can trim users in ACP.

Best regards.
* Hire me at fiverr for your phpBB board.
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
I'm learning English...
Contributions: #Hashtag, Elegance, Latte
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5885
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Mass delete of users

Post by thecoalman »

As per the suggestion above but it's Users & Groups tab >> Prune users link to left.

Not sure if it's possible to prune administrator/founder account but you can just set the joined date to after that. The founder account should be second account in most cases so that should cover all accounts accept that one. Make sure delete posts is set to no, they will revert to anonymous.

If this is big database it may choke on large prune. You can either set the joined date in small increments working backwards or if it's local install change the PHP limits.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
chanlon1
Registered User
Posts: 228
Joined: Wed Mar 09, 2005 10:01 pm
Location: Belfast, N. Ireland
Contact:

Re: Mass delete of users

Post by chanlon1 »

Thanks all. Never though of looking in there.
Had it in my head that it was only available to do it in the old STK.

Thanks.
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

Hey, I have users on the group is called Delete all.

ACP - User and Groups - Prune users

Group: Delete all //Ps, It is temporary "User defined groups", not "Pre-defined groups"
Delete pruned user posts: Yes //I have tried with No also
Deactivate or delete: Delete

Users to be pruned, check all, and Confirm Yes

And then it is like before, normal user and topics, unfortunately. So I can't delete on Prune users.

Code: Select all

max_execution_time 1500
max_input_time 1500
max_input_vars 1500
memory_limit 1G
upload_max_filesize 1G
memory_limit 1G
Can you help me?
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Mass delete of users

Post by KevC »

How many are you trying to delete at once?
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

All users on the group Delete all.
Groups Administrator, Registered users, etc is normal as before.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Mass delete of users

Post by KevC »

How many is that?

If you're going to delete everyone you might as well bin the board and start again.
What exactly are you trying to do?
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

About 8000 users of the group Delete all (User defined groups). I want to delete it.
About 50 users is normal, I will keep it on the users and forums (Pre-defined groups).
Last edited by TheDani on Tue Aug 03, 2021 8:44 pm, edited 1 time in total.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Mass delete of users

Post by KevC »

Try doing smaller numbers of accounts. Deleting 8000 at once is a huge query to the database.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

ACP - User and Groups - Prune users

and then:
Prune users: Find a member, John10, Select
Prune users: Find a member, John11, Select
Prune users: Find a member, Smith17, Select
Prune users: Find a member, Smith19 Select
Prune users: Find a member, Gerry3, Select
and so on
...
...

couple of days to do it. Can you make it faster then this?

Wait, I try to have "Users to be pruned" and e.g. 50 users.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5885
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Mass delete of users

Post by thecoalman »

Set the joined date a few months* after you installed forum. This will limit the amount of members selected. After deleting the first group keep repeating and increasing the date a few months.

*The length of time depends.... but you can play around with it.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72375
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Mass delete of users

Post by KevC »

Alternatively to the suggestion above
You can select whole pages of users at once. That is also determined by the topics per page value in the post options. Make that 500, select 500 at once and delete.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

On the 3rd Aug, I had to "fix" phpmyadmin on phpbb_users/phpbb_groups/etc.
I regret it, and restored database from 2nd Aug. So now I have from the beginning on 2nd Aug:

Admin -> Users and Group -> Manage groups:
Pre-defined groups: Registered users - 8000 users.
User defined groups: Delete users - 0 users.

I want to have like this:
Pre-defined groups: Registered users - 100 users.
User defined groups: Delete users - 7900 users.

Later I have Prune user on 7900 users.
Group: Delete users
Delete pruned user posts: No
Deactivate or delete: Delete


I can add Delete users one user after another user, e.g. Group members :: Delete users
and then add:
- Username: Find a member, James43, Select
- Username: Find a member, John10, Select
- Username: Find a member, Smith2, Select
...
and so on, but with 7900 users. So much work with that.

But it is not possible to have Prune users right now.


How can I add 7900 users to the group Delete users?
TheDani
Registered User
Posts: 394
Joined: Tue Apr 10, 2012 12:48 pm

Re: Mass delete of users

Post by TheDani »

From Registered users, I want to keep 100 users and delete 7900 users.

Manage groups:
Pre-defined groups - Registered users = 8
User defined groups - Delete users = 19
User defined groups - Temporary users = 18


1. //From Registered users to Temporary users, I want to keep these

Code: Select all

UPDATE phpbb_users SET group_id=18 WHERE user_id=1652; //James 
UPDATE phpbb_users SET group_id=18 WHERE user_id=6652; //John 
UPDATE phpbb_users SET group_id=18 WHERE user_id=732; //Smiths 
UPDATE phpbb_users SET group_id=18 WHERE user_id=42; //Smiths9
UPDATE phpbb_users SET group_id=18 WHERE user_id=314; //Harry
... up to 100 users

Code: Select all

UPDATE phpbb_user_group SET group_id=18 WHERE user_id=1652; //James 
UPDATE phpbb_user_group SET group_id=18 WHERE user_id=6652; //John 
UPDATE phpbb_user_group SET group_id=18 WHERE user_id=732; //Smiths 
UPDATE phpbb_user_group SET group_id=18 WHERE user_id=42; //Smiths9
UPDATE phpbb_user_group SET group_id=18 WHERE user_id=314; //Harry
... up to 100 users


2. //The rest is delete users, from Registered users to Delete users

Code: Select all

UPDATE phpbb_users SET group_id=19 WHERE group_id=8;
UPDATE phpbb_user_group SET group_id=19 WHERE group_id=8;

3. //Remove 7900 users
Prune users
Group: Delete users
Delete pruned user posts: No
Deactivate or delete: Delete


4. //finally I have from Temporary users to Registered users

Code: Select all

UPDATE phpbb_user_group SET group_id=8 WHERE group_id=18;

I have not tried this. But is there a simpler way to do it?



Edit: I finally done it. Skip Delete and Temporary users, only Registered users.

Admin -> Prune users
- Group: All groups
- Pruned users: [ Find a member ]
- Mark all (cross on on the checkboxes on deleted users), except a few users (cross off, keep these users)
- Select Markeded
Here you have deleted users
- Delete pruned user posts: No
- Deactivate or delete: Delete
- Submit
- Users to be pruned (cross on on the checkboxes on deleted users - one more time)
- Confirm: Yes
Post Reply

Return to “[3.3.x] Support Forum”