How to Convert a Maxmind .MMDB to .DAT?
Asked Answered
A

4

30

How to convert MaxMinds MMDB GeoIP to DAT format so that I can use with modsecurity+Apache. Modsecurity supports only DAT format.

Azpurua answered 10/1, 2014 at 17:18 Comment(4)
Why can't you use an existing a legacy database (i.e., .dat file)? MaxMind provides GeoLite and GeoIP in both formats.Potheen
Thanks 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.Azpurua
The .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.Brewis
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: blog.maxmind.com/2019/12/18/…Vivacious
C
26

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:

https://www.miyuru.lk/geoiplegacy

Cassidycassie answered 14/2, 2019 at 22:56 Comment(0)
P
6

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.

Potheen answered 15/1, 2014 at 23:37 Comment(8)
Unfortunately, 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 dev.maxmind.com/geoip/legacy/geoliteRosemari
You are correct that the legacy GeoLite databases are going away. Currently, there is no EOL date for the legacy GeoIP databases.Potheen
I can confirm that the files are now gone from the MaxMind website.Allamerican
If anyone want them, I posts the DAT files I convert hereIndehiscent
@miyuru,your DAT files cause broken in piwik 2.18Snug
@Snug 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).Indehiscent
@Indehiscent Thanks for this. Do you know which .dat format works with Webalizer? Is it country?Laryngotomy
These don't seem to work for Webalizer :( #75584387Laryngotomy
S
1

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?

Sortilege answered 9/10, 2020 at 13:17 Comment(1)
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.Jowl
H
0

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.

Hooves answered 8/4, 2023 at 19:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.