1 # Advanced installations
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).
8 ## Importing multiple regions
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:
16 │ │ └── sequence.state
22 ├── andorra-latest.osm.pbf
23 └── monaco-latest.osm.pbf
28 The `sequence.state` files will contain the sequence ID, which will be used be pyosmium to get updates. The tmp folder is used for import dump.
30 ### Configuring multiple regions
32 The file `import_multiple_regions.sh` needs to be edited as per your requirement:
34 1. List of countries. eg:
36 COUNTRIES="europe/monaco europe/andorra"
38 2. Path to Build directory. eg:
40 NOMINATIMBUILD="/srv/nominatim/build"
42 3. Path to Update directory. eg:
44 UPDATEDIR="/srv/nominatim/update"
46 4. Replication URL. eg:
48 BASEURL="https://download.geofabrik.de"
49 DOWNCOUNTRYPOSTFIX="-latest.osm.pbf"
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`.
56 ### Setting up multiple regions
58 Run the following command from your Nominatim directory after configuring the file.
60 bash ./utils/import_multiple_regions.sh
62 ## Updating multiple regions
64 To import multiple regions in your database, you need to configure and run ```utils/update_database.sh```.
65 This uses the update directory set up while setting up the DB.
67 ### Configuring multiple regions
69 The file `update_database.sh` needs to be edited as per your requirement:
71 1. List of countries. eg:
73 COUNTRIES="europe/monaco europe/andorra"
75 2. Path to Build directory. eg:
77 NOMINATIMBUILD="/srv/nominatim/build"
79 3. Path to Update directory. eg:
81 UPDATEDIR="/srv/nominatim/update"
83 4. Replication URL. eg:
85 BASEURL="https://download.geofabrik.de"
86 DOWNCOUNTRYPOSTFIX="-updates"
88 5. Followup can be set according to your installation. eg: For Photon,
90 FOLLOWUP="curl http://localhost:2322/nominatim-update"
92 will handle the indexing.
94 ### Updating the database
96 Run the following command from your Nominatim directory after configuring the file.
98 bash ./utils/update_database.sh
100 This will get diffs from the replication server, import diffs and index the database. The default replication server in the script([Geofabric](https://download.geofabrik.de)) provides daily updates.
102 ## Verification and further setup
104 Instructions for import verification and other details like importing Wikidata can be found in [import and update page](Import-and-Update.md)