Skip to content

City Lookup

Alexander Elchlepp edited this page Mar 29, 2026 · 8 revisions

When creating or editing an address for a customer the hotel management tool has an automatic city lookup based on a given postal code implemented. When entering a postal code a list with cities is displayed and when selected the city field will be filled. The lookup is also performed on the tourism statistics page when switchung between state and country view.

In order to use this function a database for your country or other countries must be manually imported.

At the moment databases from the geonames project are supported. Please pick one or more countries you wish to import and download them from here: http://download.geonames.org/export/zip/

Afterwards, extract the zip file to e.g. /opt/data.

Next, go to the fewohbee root folder and execute the build-in command to do the import (e.g. with cities of germany).

php bin/console app:import-postalcodedata "DE/DE.txt"

... or when using fewohbee-dockerized

cd /opt/fewohbee-dockerized
# copy file into the container
docker compose cp ../data/DE/DE.txt php:/var/www/html

docker compose exec --user www-data php /bin/sh -c "php fewohbee/bin/console --env=prod app:import-postalcodedata DE.txt"

... or in Portainer CE

Either use the GUI and navigate to Volumes find the feb-data volume and click browse to upload the file.

Or in the terminal:

  • remeber the Mount Path from the feb-data volume (Portainer -> Volumes -> feb-data)

  • copy the file on the host to the mount path directory of feb-data, e.g.

    cp DE.txt /var/lib/docker/volumes/fewohbee-dockerized_feb-data/_data
  • In Portainer, navigate to Containers and click on the php container.

  • Open the Exec Console tab.

  • Configure the console:

    • Command: /bin/sh
    • User: www-data
  • Click Connect, then run:

    php fewohbee/bin/console --env=prod app:import-postalcodedata DE.txt

Update

If you want to update the database with a newer version of the genonames database please add the --override option to the command:

php bin/console --env=prod app:import-postalcodedata "DE/DE.txt" --override

Clone this wiki locally