Dev3182805
Dev3182805

Reputation: 301

How to Convert a Maxmind .MMDB to .DAT?

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

Upvotes: 30

Views: 35192

Answers (4)

rustyx
rustyx

Reputation: 85276

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.

Upvotes: 0

oliiix
oliiix

Reputation: 149

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?

Upvotes: 1

IanB
IanB

Reputation: 2694

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

Upvotes: 26

Greg Oschwald
Greg Oschwald

Reputation: 1735

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.

Upvotes: 6

Related Questions