This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Nominatim database connect

0

Hi, I've got a server running nominatim with planet database.

As I wanted to update my data I've imported a new planet file into a second database on the same server.

How can I change the database which should be used?

Do I have to modify this line in the directory build/settings/settings.php?: @define('CONST_Database_DSN', 'pgsql://@/nominatim'); // <driver>://<username>:<password>@<host>:<port>/<database>

asked 17 Jun '19, 14:55

Maik28's gravatar image

Maik28
11223
accept rate: 0%

A Nominatim import is usually done with the setup.php script which loads its configuration from settings.php. If you have managed to import into a second database, then you will likely have made that modification already?

(17 Jun '19, 23:18) Frederik Ramm ♦

I did the second import with osm2pgsql.

My plan was to test Nominatim with the new database and then switch over. (I hope it doesn't matter how the import was done especially because the database schema is different)

(18 Jun '19, 09:19) Maik28

If you have not used the exact same commandline flags that Nominatim uses during your second import (especially -o gazetteer but also others) then your second import is not usable for Nominatim at all. If you have used these flags then it can be used, but you need to run a series of steps, notably the indexing steps, before you can use it. Have a look at the source code of setup.php and all the steps it performs when you run it with --all; essentially you need to run all these minus the bare import. -- The easiest & most foolproof way to re-import into a second database is to copy your whole Nominatim directory, change the settings.php connection string to point to a new database, and then run setup.php in that new directory.

(18 Jun '19, 09:33) Frederik Ramm ♦

Source code available on GitHub .