Follow the procedure below in order to update your existing Geo Location dataset to use in Configuring Geolocation Based Statistics.
- Download the latest CSV file from here.
Download the geoip-2-csv-converter from https://github.com/maxmind/geoip2-csv-converter/releases according to your operating system.
Prepare the database entries
- Unzip the latest CSV file and the geoip-2-csv-converter you have downloaded in the steps above.
Run update-geolocation-data.sh file using the command below.
Enter the path to the extracted GeoLite2-City-Blocks-IPv4 directory which you downloaded first, as the response for Enter path to GeoLite2-City-Blocks-IPv4 directory:
E.g : /<PATH_TO>/GeoLite2-City-CSV_20171107
Enter the path to geoip2-csv-converter directory as the response for Enter path to geoip2-csv-converter home directory:
E.g : /<PATH_TO>/geoip2-csv-converter-v1.0.0
After executing the script, you will find the
final.csvfile inside your current directory.
- Shut down both APIM and APIM-Analytics servers if you are running them already.
- Truncate BLOCKS and LOCATION tables from the GEO_LOCATION_DATA database.
Alternatively you can drop the tables in the GEO_LOCATION_DATA database and create new tables.
Import the created
final.csvfile into BLOCKS table. Use the command given below.
GeoLite2-City-Locations-en.csvfile located inside the extracted geoip-2-csv-converter directory (e.g geoip-2-csv-converterGeoLite2-City-CSV_2017110) into LOCATION table. Use the command given below.
Restart WSO2 API Manager and WSO2 APIM-Analytics servers.
You have now updated the Geo Location Data Set.