After a recent server migration, I noticed that I had failed to install Geo::IP::PurePerl, so I had several months of players without any location information.
I decided to write a short Perl script which iterates through all of the players in the HLX:CE database, grabs their IP, finds their location, and updates it in the database. It's pretty fast, as on my database of around 7,000 players, it takes around 5 seconds to complete.
To get it to work, just update the fields at the top of the file with the correct DB username password and host. It needs your GeoLiteCity.dat file to work, so either stick this file in the same location as your GeoLiteCity.dat, or change the path to point to it. Don't forget to run install_binary.sh first before running this script!
The script can be found below:
https://github.com/Pricetx/HLStatsX-GeoIP-Update
If you have any issues, let me know and I'll try to assist. Also, this is the first thing I've done in Perl, so if you notice anything incorrect or potentially dangerous, please let me know.