1 # Updating the Database
3 There are many different ways to update your Nominatim database.
4 The following section describes how to keep it up-to-date using
5 an [online replication service for OpenStreetMap data](https://wiki.openstreetmap.org/wiki/Planet.osm/diffs)
6 For a list of other methods to add or update data see the output of
7 `nominatim add-data --help`.
10 If you have configured a flatnode file for the import, then you
11 need to keep this flatnode file around for updates.
13 #### Installing the newest version of Pyosmium
15 It is recommended to install Pyosmium via pip. Make sure to use python3.
16 Run (as the same user who will later run the updates):
19 pip3 install --user osmium
22 Nominatim needs a tool called `pyosmium-get-changes` which comes with
23 Pyosmium. You need to tell Nominatim where to find it. Add the
24 following line to your `.env`:
26 NOMINATIM_PYOSMIUM_BINARY=/home/user/.local/bin/pyosmium-get-changes
28 The path above is fine if you used the `--user` parameter with pip.
29 Replace `user` with your user name.
31 #### Setting up the update process
33 Next the update needs to be initialised. By default Nominatim is configured
34 to update using the global minutely diffs.
36 If you want a different update source you will need to add some settings
37 to `.env`. For example, to use the daily country extracts
38 diffs for Ireland from Geofabrik add the following:
40 # base URL of the replication service
41 NOMINATIM_REPLICATION_URL="https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates"
42 # How often upstream publishes diffs
43 NOMINATIM_REPLICATION_UPDATE_INTERVAL=86400
44 # How long to sleep if no update found yet
45 NOMINATIM_REPLICATION_RECHECK_INTERVAL=900
47 To set up the update process now run the following command:
49 ./nominatim replication --init
51 It outputs the date where updates will start. Recheck that this date is
54 The `replication --init` command needs to be rerun whenever the replication
57 #### Updating Nominatim
59 The following command will keep your database constantly up to date:
61 ./nominatim replication
63 If you have imported multiple country extracts and want to keep them
64 up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions
65 to set up and update multiple country extracts.