Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

IP HIstory Extension: Can the IPs be cleared?

Andy KAndy K
edited October 2007 in Vanilla 1.0 Help
Hey all, I've been using IP History on my site since the IP History tool was available. It rocks and has helped me troubleshoot a few client issues, and also help scope out possible community issues (ie "users posting with two IDs pretending to be different people, etc").

Unfortunately, now the IP history is quite large, and causes slowdown if you access an account page of a user who has logged in from a variety of IPs. It's common on my site to have users who logged in from 30 different IPs. Some users have logged in from hundreds.

Is there a fast track to wiping out the IP list in MySQL? I'm just looking to wipe the db and start over. I have phpmyadmin for MySQL usage, and I'm comfortable with queries and the like, but by no means a guru, so I don't want to f--- something up without asking first.



  • Options
    Always take backups if you're doing something you're not sure of. But i'm pretty sure as a mysql command TRUNCATE `tablename` should be pretty effective at wiping it. If not there's a pretty easy to understand option in the phpmyadmin options tab (working totally from memory here, sorry)
  • Options
    Rather than delete some potentially useful information, you can set a upper limit for the number of history records returned.

    Looking in the source, the history is pulled from the DB in library\People\People.Class.UserManager at line 323

    I would suggest adding something like this to the query: ORDER BY DateLogged DESC LIMIT 0, 10

    Don't know SqlBuilder well enough to code this, but can try some things out if need be.

    A non-solution would be to turn off the 'IP addresses visible' permission for your role, and turn it on when needed.
  • Options
    MarkMark Vanilla Staff
    edited November 2006
    As Mini said, back everything up first.

    To remove all records from the LUM_IpHistory table, you can use the following query:

    truncate table LUM_IpHistory;

    To remove all records before the last 30 days, you can use the following query:

    delete from LUM_IpHistory where DateLogged < date_sub(curdate(), interval 30 day);
  • Options
    Thanks for the comments guys! I'll give it a shot later this week.

  • Options
    *marks a square out on the floor, writes the word 'corrected', and stands in it.
  • Options
    Hey all: It's been almost a year since I got around to it. Out of 2,000,000 records on my DB, approx 210MB of SQL data: IP Address LUM_IpHistory was 1,600,000 records and 150MB of data! Wow!

    So I ran the truncate query above and it nuked that table, and there were no problems at all after running the operation.

    However, I'm noticing that the table is growing large quickly again. I have no problem with truncating it once a month or whatever, but I was wondering if there was just a way to get that table to stop updating (or do I want to?) ? I removed the IP logging extension, and in my App settings I have "Log & monitor all IP addresses" unchecked), yet still it grows...


This discussion has been closed.