How to convert MaxMinds MMDB GeoIP to DAT format so that I can use with modsecurity+Apache. Modsecurity supports only DAT format.
-
1Why can't you use an existing a legacy database (i.e., .dat file)? MaxMind provides GeoLite and GeoIP in both formats. – Greg Oschwald Jan 10 '14 at 19:12
-
1Thanks for your response Oschwald. Yes I can use the .dat file as long as they provide. But I was not sure in future they may stop supporting .dat format. – Dev3182805 Jan 15 '14 at 20:42
-
3The .dat files are now taken off the website. geoiplookup doesn't seem to notice the .mmdb files. Does anyone know why this is. I am running arch linux with geoip and the new mmdb files downloaded but there is no city output unless I find and copy the old .dat files. Thanks. – fictitiousexistence Jan 20 '19 at 20:43
-
This change affects/breaks many of answers given on this page: "Due to upcoming data privacy regulations, we are making significant changes to how you access free GeoLite2 databases starting December 30, 2019." READ: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ – B. Shea Feb 10 '20 at 16:47
4 Answers
As of February 2019, the following Python script is the best option for converting GeoIP2 MMDB format to legacy .dat format:
https://github.com/sherpya/geolite2legacy
Using this script, somebody has done the conversion and made the resulting .dat files available for download:

- 2,642
- 22
- 25
The Legacy GeoIP builds (.dat) are not going away in the near future. If they do ever go away, you could build off of the .dat build program that Debian uses for its GeoLite databases (copy of it on GitHub) or this (untested) Python script.

- 1,716
- 2
- 11
- 14
-
3Unfortunately, this is no longer true; the legacy .dat files _are_ going away, and they're already (as of April 2018) no longer being updated; see notice on https://dev.maxmind.com/geoip/legacy/geolite/ – geerlingguy Jun 01 '18 at 15:31
-
You are correct that the legacy GeoLite databases are going away. Currently, there is no EOL date for the legacy GeoIP databases. – Greg Oschwald Jun 09 '18 at 17:43
-
6
-
4If anyone want them, I posts the DAT files I convert [here](https://www.miyuru.lk/geoiplegacy) – miyuru Feb 07 '19 at 08:27
-
-
@kittygirl I found the issue. piwiks default ip check fails, because it doesn't match the expected result. I will try to fix it in the next release(March). – miyuru Feb 27 '19 at 10:37
-
@miyuru Thanks for this. Do you know which .dat format works with Webalizer? Is it country? – OwN Feb 27 '23 at 17:40
-
These don't seem to work for Webalizer :( https://stackoverflow.com/questions/75583887/webalizer-geoip-dat-updates-mrunix-net-offline – OwN Feb 27 '23 at 18:25
Firstly, what I have to say to some here: You are required by MaxMind to update to new databases until 30 days after they get released (EULA point 4.c), so using old databases is actually not legit; also, the data from old databases is simply outdated (probably not valid anymore), so why use it in the first place?

- 796
- 1
- 11
- 27

- 149
- 1
- 7
-
I consider this an answer - at least a valid contribution to the problem solving. But you might want to rephrase to make the answering part more obvious. The "Thanks" better go into a comment. – Yunnosch Oct 10 '20 at 07:42
An alternative solution is to install the geoip-database
package from the Debian repo.
It'll install the country database at /usr/share/GeoDB/GeoIP.dat
Currently the stable
branch has an old version, but testing
is relatively up-to-date.

- 80,671
- 25
- 200
- 267