]> git.openstreetmap.org Git - nominatim.git/blob - docs/admin/Advanced-Installations.md
Put install instructions of test tools into separate docs/ markdown file
[nominatim.git] / docs / admin / Advanced-Installations.md
1 # Advanced installations
2
3 This page contains instructions for setting up multiple countries in 
4 your Nominatim database. It is assumed that you have already successfully
5 installed the Nominatim software itself, if not return to the 
6 [installation page](Installation.md).
7
8 ## Importing multiple regions
9
10 To import multiple regions in your database, you need to configure and run `utils/import_multiple_regions.sh` file. This script will set up the update directory which has the following structure:
11
12 ```bash
13 update
14     ├── europe
15     │   ├── andorra
16     │   │   └── sequence.state
17     │   └── monaco
18     │       └── sequence.state
19     └── tmp
20         ├── combined.osm.pbf
21         └── europe
22                 ├── andorra-latest.osm.pbf
23                 └── monaco-latest.osm.pbf
24
25
26 ```
27
28 The `sequence.state` files will contain the sequence ID, which will be used by pyosmium to get updates. The tmp folder is used for import dump.
29
30 ### Configuring multiple regions
31
32 The file `import_multiple_regions.sh` needs to be edited as per your requirement:
33
34 1. List of countries. eg:
35
36         COUNTRIES="europe/monaco europe/andorra"
37
38 2. Path to Build directory. eg:
39
40         NOMINATIMBUILD="/srv/nominatim/build"
41
42 3. Path to Update directory. eg:
43         
44         UPDATEDIR="/srv/nominatim/update"
45
46 4. Replication URL. eg:
47     
48         BASEURL="https://download.geofabrik.de"
49         DOWNCOUNTRYPOSTFIX="-latest.osm.pbf"
50  
51 !!! tip
52     If your database already exists and you want to add more countries, replace the setting up part
53     `${SETUPFILE} --osm-file ${UPDATEDIR}/tmp/combined.osm.pbf --all 2>&1`
54     with `${UPDATEFILE} --import-file ${UPDATEDIR}/tmp/combined.osm.pbf 2>&1`.
55
56 ### Setting up multiple regions
57
58 Run the following command from your Nominatim directory after configuring the file.
59
60     bash ./utils/import_multiple_regions.sh
61
62 !!! danger "Important"
63         This file uses osmium-tool. It must be installed before executing the import script.
64         Installation instructions can be found [here](https://osmcode.org/osmium-tool/manual.html#installation).
65
66 ## Updating multiple regions
67
68 To import multiple regions in your database, you need to configure and run ```utils/update_database.sh```.
69 This uses the update directory set up while setting up the DB.   
70
71 ### Configuring multiple regions
72
73 The file `update_database.sh` needs to be edited as per your requirement:
74
75 1. List of countries. eg:
76
77         COUNTRIES="europe/monaco europe/andorra"
78
79 2. Path to Build directory. eg:
80
81         NOMINATIMBUILD="/srv/nominatim/build"
82
83 3. Path to Update directory. eg:
84         
85         UPDATEDIR="/srv/nominatim/update"
86
87 4. Replication URL. eg:
88     
89         BASEURL="https://download.geofabrik.de"
90         DOWNCOUNTRYPOSTFIX="-updates"
91
92 5. Followup can be set according to your installation. eg: For Photon,
93
94         FOLLOWUP="curl http://localhost:2322/nominatim-update"
95
96     will handle the indexing.
97
98 ### Updating the database
99
100 Run the following command from your Nominatim directory after configuring the file.
101
102     bash ./utils/update_database.sh
103
104 This will get diffs from the replication server, import diffs and index the database. The default replication server in the script([Geofabrik](https://download.geofabrik.de)) provides daily updates.
105
106 ## Verification and further setup
107
108 Instructions for import verification and other details like importing Wikidata can be found in [import page](Import.md)
109