Notifications
Clear all

Members List - Export to csv?

5 Posts
2 Users
0 Reactions
776 Views
ffooccuuss
Posts: 28
Topic starter
(@ffooccuuss)
Trusted Member
Joined: 1 year ago

I don't see any option to export the members list. Can someone build an SQL query I can run in phpmyadmin to export the entire members list to a csv file? 

My goal is to review that list and modify the query to change the usergroup to "flagged" for any member who has not logged in within 2 years and has never posted. Once I have those in that usergroup, and do a final review, I would like to delete them all. 

Is this a reasonable approach to cleaning out old members? 

4 Replies
Posts: 17
(@ww_hoax)
Eminent Member
Joined: 2 months ago

You can use phpMyAdmin’s export function to export each table.

Reply
ffooccuuss
Posts: 28
Topic starter
(@ffooccuuss)
Trusted Member
Joined: 1 year ago

Here is what I envision. A developer, or one of the people here who are very familiar with the database structure here, would compose an SQL query that would do the following: 

  • Join the appropriate tables that would contain all the fields in the members list. 
  • Select all the users
  • Display the fields that are in the members list, the sort doesn't matter, I'll do that in the csv or a spreadsheet. 
  • Execute that query and let me export that list to a csv.
  • As a bonus, select all users more than 2 years since last login (or never) AND who have zero posts. 
  • For those users add them to the usergroup "Flagged". 
  • Execute that query and let me export that list to a csv.
  • Then I can modify that query to delete all those users after I review in a spreadsheet. 
  • I would test this query in my mirror website before doing this in my main production website. 

For someone familiar with the database tables, and with SQL, this shouldn't be that difficult or even time-consuming. I understand SQL and phpmyadmin I just don't have a mind to write code.

There is some implied context and knowledge, for example, there is no 'users' table with the 'wpforo' table prefix, so I assume it uses the Wordpress users tables (users and meta). But how is the wpforo ID related? IDK. How do you display the "Display Name", "Login", "Email"? And then display the wpforo info (I think) such as "Group", "Status", "Last Login", and "Forum Posts"? You have to 'join' the appropriate tables and I don't know all the relationships and contents (fields within the tables). 

This is the secret sauce that I need someone to figure out and build the SQL query. It should be relatively easy for someone familiar but impossible for a mere mortal like me. 

With tons of respect, 

Jerry in Houston, Texas

Reply
1 Reply
ffooccuuss
(@ffooccuuss)
Joined: 1 year ago

Trusted Member
Posts: 28

I do see the list of all tables and their field definitions in the 'Forum Tools' menu and the 'Database Tables' tab. But I don't understand how to use the information there. 

https://[domain]/wp-admin/admin.php?page=wpforo-tools&tab=tables

 

Reply
ffooccuuss
Posts: 28
Topic starter
(@ffooccuuss)
Trusted Member
Joined: 1 year ago

No response in 4 days? This shouldn't be difficult. I am just asking for the query that produces the members list in the wpForo menus. It already exists, I just want the SQL so I can execute it and export the resulting csv. 

Reply