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 with Pyosmium.
 
   5 For a list of other methods see the output of `./utils/update.php --help`.
 
   8     If you have configured a flatnode file for the import, then you
 
   9     need to keep this flatnode file around for updates.
 
  11 #### Installing the newest version of Pyosmium
 
  13 It is recommended to install Pyosmium via pip. Make sure to use python3.
 
  14 Run (as the same user who will later run the updates):
 
  17 pip3 install --user osmium
 
  20 Nominatim needs a tool called `pyosmium-get-changes` which comes with
 
  21 Pyosmium. You need to tell Nominatim where to find it. Add the
 
  22 following line to your `settings/local.php`:
 
  24     @define('CONST_Pyosmium_Binary', '/home/user/.local/bin/pyosmium-get-changes');
 
  26 The path above is fine if you used the `--user` parameter with pip.
 
  27 Replace `user` with your user name.
 
  29 #### Setting up the update process
 
  31 Next the update needs to be initialised. By default Nominatim is configured
 
  32 to update using the global minutely diffs.
 
  34 If you want a different update source you will need to add some settings
 
  35 to `settings/local.php`. For example, to use the daily country extracts
 
  36 diffs for Ireland from Geofabrik add the following:
 
  38     // base URL of the replication service
 
  39     @define('CONST_Replication_Url', 'https://download.geofabrik.de/europe/ireland-and-northern-ireland-updates');
 
  40     // How often upstream publishes diffs
 
  41     @define('CONST_Replication_Update_Interval', '86400');
 
  42     // How long to sleep if no update found yet
 
  43     @define('CONST_Replication_Recheck_Interval', '900');
 
  45 To set up the update process now run the following command:
 
  47     ./utils/update.php --init-updates
 
  49 It outputs the date where updates will start. Recheck that this date is
 
  52 The `--init-updates` command needs to be rerun whenever the replication service
 
  55 #### Updating Nominatim
 
  57 The following command will keep your database constantly up to date:
 
  59     ./utils/update.php --import-osmosis-all
 
  61 (Note that even though the old name "import-osmosis-all" has been kept for
 
  62 compatibility reasons, Osmosis is not required to run this - it uses pyosmium
 
  65 If you have imported multiple country extracts and want to keep them
 
  66 up-to-date, [Advanced installations section](Advanced-Installations.md) contains instructions 
 
  67 to set up and update multiple country extracts.