2020-06-20 04:48:07 +03:00
|
|
|
# Updating the Database
|
|
|
|
|
|
|
|
There are many different ways to update your Nominatim database.
|
2021-01-14 14:04:08 +03:00
|
|
|
The following section describes how to keep it up-to-date using
|
|
|
|
an [online replication service for OpenStreetMap data](https://wiki.openstreetmap.org/wiki/Planet.osm/diffs)
|
|
|
|
For a list of other methods to add or update data see the output of
|
|
|
|
`nominatim add-data --help`.
|
2020-06-20 04:48:07 +03:00
|
|
|
|
2020-12-06 19:28:33 +03:00
|
|
|
!!! important
|
2020-06-20 04:48:07 +03:00
|
|
|
If you have configured a flatnode file for the import, then you
|
2020-12-06 19:28:33 +03:00
|
|
|
need to keep this flatnode file around for updates.
|
2020-06-20 04:48:07 +03:00
|
|
|
|
|
|
|
#### Installing the newest version of Pyosmium
|
|
|
|
|
|
|
|
It is recommended to install Pyosmium via pip. Make sure to use python3.
|
|
|
|
Run (as the same user who will later run the updates):
|
|
|
|
|
|
|
|
```sh
|
|
|
|
pip3 install --user osmium
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Setting up the update process
|
|
|
|
|
|
|
|
Next the update needs to be initialised. By default Nominatim is configured
|
|
|
|
to update using the global minutely diffs.
|
|
|
|
|
|
|
|
If you want a different update source you will need to add some settings
|
2020-12-20 14:09:27 +03:00
|
|
|
to `.env`. For example, to use the daily country extracts
|
2020-06-20 04:48:07 +03:00
|
|
|
diffs for Ireland from Geofabrik add the following:
|
|
|
|
|
2020-12-20 14:09:27 +03:00
|
|
|
# base URL of the replication service
|
|
|
|
NOMINATIM_REPLICATION_URL="https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates"
|
2021-05-04 12:47:15 +03:00
|
|
|
# How often upstream publishes diffs (in seconds)
|
2020-12-20 14:09:27 +03:00
|
|
|
NOMINATIM_REPLICATION_UPDATE_INTERVAL=86400
|
2021-05-04 12:47:15 +03:00
|
|
|
# How long to sleep if no update found yet (in seconds)
|
2020-12-20 14:09:27 +03:00
|
|
|
NOMINATIM_REPLICATION_RECHECK_INTERVAL=900
|
2020-06-20 04:48:07 +03:00
|
|
|
|
|
|
|
To set up the update process now run the following command:
|
|
|
|
|
2021-02-01 19:27:01 +03:00
|
|
|
nominatim replication --init
|
2020-06-20 04:48:07 +03:00
|
|
|
|
|
|
|
It outputs the date where updates will start. Recheck that this date is
|
|
|
|
what you expect.
|
|
|
|
|
2021-01-14 14:04:08 +03:00
|
|
|
The `replication --init` command needs to be rerun whenever the replication
|
|
|
|
service is changed.
|
2020-06-20 04:48:07 +03:00
|
|
|
|
|
|
|
#### Updating Nominatim
|
|
|
|
|
|
|
|
The following command will keep your database constantly up to date:
|
|
|
|
|
2021-02-01 19:27:01 +03:00
|
|
|
nominatim replication
|
2020-06-20 04:48:07 +03:00
|
|
|
|
|
|
|
If you have imported multiple country extracts and want to keep them
|
|
|
|
up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions
|
|
|
|
to set up and update multiple country extracts.
|