How can I compile a GeoLite CSV file into MMDB again?

2.5k Views Asked by At

I have made a few corrections to location names in a GeoLite2 CSV file. My site only retrieves locations from the MMDB file, so how can I compile back the changed CSV file into the MMDB binary again. I searched everywhere for a solution but can't find it.

Thanks for any tip. Carlos

2

There are 2 best solutions below

0
Filippo Vitale On

Currently there are only 2 open source MMDB file writers:

The second one unfortunately has only a subset of the features available for the Perl one, but it should be enough for writing a program that creates the MMDB file reading line by line the CSV one and creating the mmdbtype instances.

3
Reincoder On

You can check out our mmdbctl utility tool.

To convert a CSV file to an MMDB file use the import command:

$ mmdbctl import --in data.csv --out data.mmdb

Instructions, features, and documentation are available here: github.com/ipinfo/mmdbctl.

Right now it only supports string data types, and not nested data types. See this issue for more information.