This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How can I manually update offline db with the new osm data change set

0

I've built a working tile server from the switch2osm instructions.
Since the server has no internet access, I need to find a way to keep the data up to date.
I found many scripts/services that fetch the new data from osm and update the db automatically but since I have no internet connection they can not be used
Is there any way to manually download the xml change set from internet access computer and update the db (https://planet.openstreetmap.org/planet/changesets-latest.osm.bz2)?

asked 22 Feb '22, 14:21

aviram-s's gravatar image

aviram-s
11113
accept rate: 0%

edited 22 Feb '22, 14:26


One Answer:

0

You have the wrong file - what you need is not the changeset file but a series of "diffs" from https://planet.openstreetmap.org/replication/ that cover the whole time from when you did the server setup to now.

The manual process is:

  • download all files individually
  • optionally merge them into a larger file with osmosis or osmium
  • copy the individual files or the combined file onto the tile server machine
  • apply the individual files or the combined file to your database with osm2pgsql using the exact same command line flags as on the initial import but use the --append flag instead of --create (which is the default)

You could also use osmosis or pyosmium-get-changes to make this easier for you, as these tools have the option of saving their last replication state, so you could let them "download all since last time" and you would not have to go through the hassle of downloading individual files.

Note that updating with diffs only makes sense as long as your data is not older than three or four weeks; once your data is older than that, a full new import is faster than trying diff updates.

answered 22 Feb '22, 14:32

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .