# Changes to Accessing and Using GeoLite2 Databases

**URL:** <https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195>\
**Category:** Product Support\
**Created:** [January 2, 2020, 8:13pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195 "2020-01-02T20:13:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [January 2, 2020, 8:13pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/1 "2020-01-02T20:13:18Z")

</div>

**Your software**  
My Mautic version is: 2.15.3  
My PHP version is: 7.2

**Your problem**  
My problem is: GeoLite2 City Download, Automatically fetching the IP lookup data failed.

This message is from [Maxmind.com](http://Maxmind.com)  
\*Starting December 30, 2019, we will be requiring users of our GeoLite2 databases to register for a MaxMind account and obtain a license key in order to download GeoLite2 databases.  
\*_Starting December 30, 2019, downloads will no longer be served from our public GeoLite2 page, from [geolite.maxmind.com/download/geoip/database/](http://geolite.maxmind.com/download/geoip/database/)_

I can update the database manually, hoping to do this automatically.

**These errors are showing in the log:**  
[2020-01-02 13:17:02] mautic.ERROR: Failed to fetch remote IP data: Could not resolve host: [geolite.maxmind.com](http://geolite.maxmind.com)    
[2020-01-02 13:17:02] mautic.NOTICE: PHP Notice - Undefined variable: data - in file \*\*\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 90 {“connector”:"[object] (Joomla\Http\Http: {})",“package”:“[http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",“exception”:"[object]](http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz%22,%22exception%22:%22%5Bobject%5D) (RuntimeException(code: 0): Could not resolve host: [geolite.maxmind.com](http://geolite.maxmind.com) at \*\*\wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)”,“tempTarget”:" \*\*\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gz",“tempExt”:“gz”,“localTarget”:" \*\*\wordpress\mautic\app\cache\prod/…/ip\_data/GeoLite2-City.mmdb",“localTargetExt”:“mmdb”,“success”:false,“memLimit”:134217728,“freeMem”:91146192}   
[2020-01-02 13:17:02] mautic.NOTICE: PHP Notice - Trying to get property ‘body’ of non-object - in file  
\*\*\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 90 {“connector”:"[object] (Joomla\Http\Http: {})",“package”:“[http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",“exception”:"[object]](http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz%22,%22exception%22:%22%5Bobject%5D) (RuntimeException(code: 0): Could not resolve host: [geolite.maxmind.com](http://geolite.maxmind.com) at _\wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)",“tempTarget”:"_\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gz”,“tempExt”:“gz”,“localTarget”:"\*\wordpress\mautic\app\cache\prod/…/ip\_data/GeoLite2-City.mmdb",“localTargetExt”:“mmdb”,“success”:false,“memLimit”:134217728,“freeMem”:91146192}

**Steps I have tried to fix the problem:**  
I registered for a MaxMind account and obtained a license key. Entered IP lookup service authentication using format username:password. I’ve tried username:password to access [maxmind.com](http://maxmind.com) and userID:Licenscekey (they are different)

---

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [January 2, 2020, 9:00pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/2 "2020-01-02T21:00:22Z")

</div>

Reading my log i thought it might be a memory issue. Increase my PHP limit to 256M and i get error log to show my this now:  
[2020-01-02 14:51:39] mautic.WARNING: PHP Warning - gzdecode(): data error - in file \*\*\wordpress\mautic\app\bundles\CoreBundle\IpLookup\AbstractLocalDataLookup.php - at line 91 {“connector”:"[object] (Joomla\Http\Http: {})",“package”:“[http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",“exception”:"[object]](http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz%22,%22exception%22:%22%5Bobject%5D) (RuntimeException(code: 0): Could not resolve host: [geolite.maxmind.com](http://geolite.maxmind.com) at \*\*\wordpress\mautic\vendor\joomla\http\src\Transport\Curl.php:185)”,“tempTarget”:" \*\*\[millwrightsites.com](http://millwrightsites.com)\wordpress\mautic\app\cache\prod/GeoLite2-City.mmdb.gz",“tempExt”:“gz”,“localTarget”:" \*\*\wordpress\mautic\app\cache\prod/…/ip\_data/GeoLite2-City.mmdb",“localTargetExt”:“mmdb”,“success”:false,“memLimit”:268435456,“freeMem”:225364000}

---

<div class="post-metadata">

**Author:** ![MxyzptlkFishStix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mxyzptlkfishstix/32/1132_2.png) [@MxyzptlkFishStix](https://forum.mautic.org/u/MxyzptlkFishStix)\
**Post date:** [January 2, 2020, 11:53pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/3 "2020-01-02T23:53:46Z")

</div>

> <https://github.com/mautic/mautic/issues/8275>
>
> Bug Description
> Mautic uses Maxmind dataset as the default IP lookup database. It cannot be downloaded directly since yesterday. Users must register...

---

<div class="post-metadata">

**Author:** ![quangmai911](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/quangmai911/32/1471_2.png) [@quangmai911](https://forum.mautic.org/u/quangmai911)\
**Post date:** [January 11, 2020, 5:15am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/4 "2020-01-11T05:15:14Z")

</div>

Hi all,

I am quite new with Mautic. And first time playing with this platform. However, when i finished set up Mautic I am stucked at the GeoIP GeoLite2 City from maxmind. I could not fetch it to update the new data.

I follow this tips `https://github.com/mautic/mautic/issues/8275`

However, I am still stucked at the last step. Put in the folder. I put the file exactly where the path shown with File Manager in Cpanel and grand the permission for read/write etc… Put the issue can not solve yet. Any ideas please. Thank you so much. 😇

Quang

---

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [January 13, 2020, 2:58pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/5 "2020-01-13T14:58:29Z")

</div>

This solution does not fix the fetch button. This solution takes place of the fetch. Everything your doing in theses steps is what the fetch button does automatically. Mautic will update there code soon to give us a solution.

---

<div class="post-metadata">

**Author:** ![autoize](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/autoize/32/105_2.png) [@autoize](https://forum.mautic.org/u/autoize)\
**Post date:** [January 14, 2020, 11:43pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/6 "2020-01-14T23:43:46Z")

</div>

For those administering their Mautic instance from the command line, the best way to transfer the **GeoLite2-City.mmdb** file to the **app/cache/ip\_data/** folder is using the **scp** command line utility.

First, comment out the automatic update cron job in **/etc/crontab** (system-wide crontab) or user-specific crontab, **crontab -u www-data -e** with a **#** symbol.

Then, simply upload the .tar.gz file downloaded from your MaxMind account to your home directory (e.g. /home/ubuntu/GeoLite2-City\_20200107.tar.gz) then using the **tar -xvzf** command, extract the archive. Inside the extracted folder, you will find the GeoLite2-City.mmdb which you should **cp** to **/path/to/mautic/app/cache/ip\_data/**. If asked to overwrite, type **y** to indicate “yes.”

Finally, change ownership of the file to the web server user (e.g. apache or www-data) for good measure. **chown -R www-data:www-data /path/to/mautic/app/cache/ip\_data/GeoLite2-City.mmdb**

---

<div class="post-metadata">

**Author:** ![dageci](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dageci/32/439_2.png) [@dageci](https://forum.mautic.org/u/dageci)\
**Post date:** [January 16, 2020, 12:35pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/7 "2020-01-16T12:35:38Z")

</div>

Just a note.  
After you have manually copy-paste the database and disabled the cron job, **DON’T** click on the button “Update IP lookup data store” anymore because it will empty the database that you have just copied.

Does anybody maybe know how we can trigger the Location update for the contacts that are now without the location??  
Thanks,  
Davor

---

<div class="post-metadata">

**Author:** ![quangmai911](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/quangmai911/32/1471_2.png) [@quangmai911](https://forum.mautic.org/u/quangmai911)\
**Post date:** [January 17, 2020, 6:07am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/8 "2020-01-17T06:07:51Z")

</div>

Thanks Davor. That would be the issue which I did. After manually copy-paste and disable cron job. I immediately click the update button to refresh lookup data!!!

---

<div class="post-metadata">

**Author:** ![deejames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/deejames/32/677_2.png) [@deejames](https://forum.mautic.org/u/deejames)\
**Post date:** [February 9, 2020, 12:04pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/9 "2020-02-09T12:04:22Z")

</div>

I setup account at Maxmind for the geoip database geolite2-city; got License key and account/user ID

This is where Mautic says I should get the file:  
[http://geolite.maxmind.com/download/geoip/database/geolite2-city.mmdb.gz](http://geolite.maxmind.com/download/geoip/database/geolite2-city.mmdb.gz)

I will be uploading to CPanel; ip\_data

Below are the databases Maxmind lists to download. So Which of these database do I download?

|GeoLite2-ASN|GeoLite2 ASN|GeoIP2 Binary (APIs)|2020-02-04|GZIP (MD5)|  
|GeoLite2-ASN-CSV|GeoLite2 ASN: CSV Format|GeoIP2 CSV (docs)|2020-02-04|ZIP (MD5)|  
|GeoLite2-City|GeoLite2 City|GeoIP2 Binary (APIs)|2020-02-04|GZIP (MD5)|  
|GeoLite2-City-CSV|GeoLite2 City: CSV Format|GeoIP2 CSV (docs)|2020-02-04|ZIP (MD5)|  
|GeoLite2-Country|GeoLite2 Country|GeoIP2 Binary (APIs)|2020-02-04|GZIP (MD5)|  
|GeoLite2-Country-CSV|GeoLite2 Country: CSV Format|GeoIP2 CSV (docs)|2020-02-04|ZIP (MD5)|

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [February 9, 2020, 3:14pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/10 "2020-02-09T15:14:04Z")

</div>

I have made a step by step guide to help Mautic users with the Madmind GeoIP and Geolite2 automated database updates.

> **[\[Solved\] Maxmind GeoLite2 & GeoIP Database Auto-Update | 2020](https://mauteam.org/mautic/mautic-admins/solved-maxmind-geolite2-database-not-updating/)**
>
> Maxmind has changed the method to update GeoLite2 & GeoIP databases, it now requires you to provide your credentials. See how to solve this on any Linux server.

---

<div class="post-metadata">

**Author:** ![cottercat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cottercat/32/682_2.png) [@cottercat](https://forum.mautic.org/u/cottercat)\
**Post date:** [March 6, 2021, 5:29pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/11 "2021-03-06T17:29:35Z")

</div>

Thank you SO much… your guide worked perfectly!

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [April 22, 2021, 1:14am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/12 "2021-04-22T01:14:42Z")

</div>

Glad it was of help @cottercat, I try to keep it updated as much as I can…

---

<div class="post-metadata">

**Author:** ![aglyons](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aglyons/32/2825_2.png) [@aglyons](https://forum.mautic.org/u/aglyons)\
**Post date:** [June 16, 2021, 5:36pm UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/13 "2021-06-16T17:36:38Z")

</div>

Thanks very much for this. One question though, so there’s nothing that we need to do to let Mautic know how/where to access the DB’s?

My install is not typical in that I use Runcloud to manage my VPS. The webroot dir’s are different from a dedicated server. I modified the paths when it came to ip\_data (/home/mautic/webapps/Mautic/app/cache/ip\_data) but noticed I didn’t have that folder in the existing Mautic install, I had to create it. So how does Mautic know to get the geo data from that folder? Or am I missing something?

\*\*\*EDIT:

On further inspection. I do have a ip\_data folder but that is in Mautic/var/cache/ip\_data

Another point, does making ip\_data chmod 777 not scare the crap out of you?

---

<div class="post-metadata">

**Author:** ![nadamix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nadamix/32/441_2.png) [@nadamix](https://forum.mautic.org/u/nadamix)\
**Post date:** [June 21, 2021, 4:06am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/14 "2021-06-21T04:06:41Z")

</div>

![mautic](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c879725e1708a687744d317cbaea079618785090.png)  
I’ve got this problem. Can anyone help?

---

<div class="post-metadata">

**Author:** ![fkrafft](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fkrafft/32/2220_2.png) [@fkrafft](https://forum.mautic.org/u/fkrafft)\
**Post date:** [June 30, 2021, 9:47am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/15 "2021-06-30T09:47:46Z")

</div>

I have the same problem, used to work but doesn’t anymore with the correct authentication code from the license.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [June 30, 2021, 9:57am UTC](https://forum.mautic.org/t/changes-to-accessing-and-using-geolite2-databases/12195/16 "2021-06-30T09:57:02Z")

</div>

Make sure you are using the correct format:

> **[Maxmind license](https://docs.mautic.org/en/setup/maxmind-license)**
>
> . From the 2.16 release, Mautic has supported using a license key to access the Maxmind IP lookup service.. . . . From the 3.2 release the format for the license key needs to be AccountID:Licensekey. Account ID is displayed above the license keys...
