]> git.openstreetmap.org Git - nominatim.git/blob - docs/admin/Update.md
Merge pull request #2135 from lonvia/python-frontend
[nominatim.git] / docs / admin / Update.md
1 # Updating the Database
2
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`.
8
9 !!! important
10     If you have configured a flatnode file for the import, then you
11     need to keep this flatnode file around for updates.
12
13 #### Installing the newest version of Pyosmium
14
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):
17
18 ```sh
19 pip3 install --user osmium
20 ```
21
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`:
25
26     NOMINATIM_PYOSMIUM_BINARY=/home/user/.local/bin/pyosmium-get-changes
27
28 The path above is fine if you used the `--user` parameter with pip.
29 Replace `user` with your user name.
30
31 #### Setting up the update process
32
33 Next the update needs to be initialised. By default Nominatim is configured
34 to update using the global minutely diffs.
35
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:
39
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
46
47 To set up the update process now run the following command:
48
49     ./nominatim replication --init
50
51 It outputs the date where updates will start. Recheck that this date is
52 what you expect.
53
54 The `replication --init` command needs to be rerun whenever the replication
55 service is changed.
56
57 #### Updating Nominatim
58
59 The following command will keep your database constantly up to date:
60
61     ./nominatim replication
62
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.