會員註冊 / 登入  |  電腦版  |  Jump to bottom of page

User Forum » A big upgrade, now a few questions

發表人: James Bucanek
12 個月 前
Greetings,

It's great to get back into the JForum community!

I have an ancient (2.1.8) version of JForum that I've been running since the dark ages. I have finally gotten around to migrating it to a new Red Had server, running Tomcat 10 and Java 11.

It was a bit rough, and I had to start over three times, but I finally made it through all of the upgrades and configurations.

The forum is now hosted on its own domain (forums.dawntodusksoftware.com) using an Apache ProxyPass to redirect it to the webapp on Tomcat (localhost:8081/jforum).

So far, things are looking pretty good.

Question #1:

The forums, topics, messages, etc. all look OK, but I did see a lot of mysterious warnings from MySQL during the initial DB import. There were hundreds of messages like this:
Query OK, 267 rows affected, 11 warnings (0.022 sec)

Records: 267 Duplicates: 0 Warnings: 11

Query OK, 281 rows affected, 11 warnings (0.018 sec)
Records: 281 Duplicates: 0 Warnings: 11

Query OK, 430 rows affected, 17 warnings (0.023 sec)
Records: 430 Duplicates: 0 Warnings: 17
...

Is this something I should be worried about?

Question #2:

I'm getting ready to customize the look of the forum to match my main site. I was a little confused reading the Templates and Styles section. Do I just start editing jforum/templates/default/header.htm, et. al.?

Question #3:

I used to have a custom SSO that allowed all of my registered users to use the forum with the same account. I think I'm going to abandon that and let users create separate accounts for the forum.

It appears that JForum stores a hash of the password in the jforum_uesrs.users_password field. My SSO hack stored the value "#shadow#" in that field. Is is OK if I leave it that way and just add a note that previously registered users will need to reset their password? Or should I store some other value?

Question #4:

After running for over 10 years, I've registered a lot of spam accounts. I currently have over 400,000 user accounts, I suspect that 98% of those are spam.

A few years back I set the forum to full moderation, so I've rejected all of the spam posts. But I'd really like to delete these accounts.

Is there a script or utility I can run that will safely delete all of the user accounts without any posts?

That's it for now!

發表人: udittmer
12 個月 前
As to #1: Hard to say if MySQL doesn't tell what the warnings are. But being warnings, I wouldn't be concerned.

#2: Yes, start modifying header.html and bottom.htm, and see how far that gets you. The FreeMarker language has extensive docs at https://freemarker.apache.org/

#3: https://sourceforge.net/p/jforum2/wiki2/Documentation/ links to a few pages about SSO. But I've never used that, and the code hasn't been touched in a long time, so I'm not sure how well that still works. If you want to abandon SSO, I think any value in there is OK - nothing but the login process touches the password.

#4: The jforum_users table has a column user_posts which track the number of posts, but for the purpose of deleting accounts I'm not sure I'd trust it.

select u.user_id, u.user_email, count(p.user_id) from jforum_users u left join jforum_posts p on p.user_id = u.user_id group by u.user_id
shows you which user has how many posts

select u.user_id from jforum_users u left join jforum_posts p on p.user_id = u.user_id group by u.user_id having count(p.user_id) = 0
picks the ones that have 0 posts

delete from jforum_users where id in (select u.user_id from jforum_users u left join jforum_posts p on p.user_id = u.user_id having count(p.user_id) = 0)
deletes those having 0 posts - I think, but haven't tested it

發表人: James Bucanek
12 個月 前
 
udittmer wrote:#3: https://sourceforge.net/p/jforum2/wiki2/Documentation/ links to a few pages about SSO. But I've never used that, and the code hasn't touched in a long time, so I'm not sure how well that still works. If you want to abandon SSO, I think any value in there is OK - nothing but the login process touches the password.

I tested a few accounts and the PW reset seems to work just fine, so I'll leave them where they're at.

#4: ...

delete from jforum_users where id in (select u.user_id from jforum_users u left join jforum_posts p on p.user_id = u.user_id having count(p.user_id) = 0)

small correction: ... jforum_users where user_id in ...

So after letting that query run for 22 hours, I stopped it and took a different tact. (I suspect that MySQL was re-executing the select left join statement for every row in jforum_users, which means it was going to get executed 450,000 times.)

I ran the earlier join once to generate the list of accounts with no posts, exported it, and just massaged that into a list of 9,000 separate DELETE statements, that each deleted 50 rows. It still took 15 minutes to run, but it got there.

I've since spent some time digging around the forums, old posts, etc. and I don't see anything obviously wrong, so it looks like it worked (and I'm back down to a very manageable 839 user accounts)

Thank you again for all the help and a great program. smilie

發表人: James Bucanek
12 個月 前
Follow up:

You mentioned that you didn't trust the user_posts field to be accurate, but in the end it was.

All of the deleted accounts had a 0 value in that field, and all of the remaining accounts have non-zero values. So, in retrospect, I probably could have used that as my sole criteria. YMMV

發表人: udittmer
12 個月 前
Thanks for the feedback, it's good to hear that the code does what it is supposed to do smilie




會員註冊 / 登入  |  電腦版  |  Jump to top of page