Export planet OSM file from Rails port using Osmosis

In order to create a local OSM server and connecting JOSM to this, we’ve installed and configured Rails port openstreetmap/openstreetmap-website. The next step was to insert a sample OSM file into Rails’ Postgresql databae, using osmosis via the following command:

osmosis --read-xml file="test.osm" --write-apidb host="localhost:5432" database="openstreetmap" user="osm" password="osm" populateCurrentTables=yes validateSchemaVersion=no

JOSM connects to local OSM server and download/upload data to local database. The problem is when we want to export Rails port database into OSM file to save updates and changes created by team members using the following line:

osmosis --read-apidb host="localhost:5432" database="openstreetmap" user="osm" password="osm" --write-xml file="from_pg.osm"

Executing the command throws the following error, how it should resolve?

org.openstreetmap.osmosis.core.OsmosisRuntimeException: Database version mismatch. The schema contains unexpected migrations [20170222134109, 20161011010929, 20150111192335, 20140115192822, 20191120140058, 20160822153055, 20140117185510, 20181020114000, 20180204153242, 20150110152606, 20190518115041, 20150818224516, 20190702193519, 20150222101847, 20190623093642, 20161002153425, 20131212124700, 20140519141742, 20140210003018, 20181031113522, 20190716173946, 20140507110937], may need to upgrade osmosis or specify validateSchemaVersion=no.
    at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.validateDBVersion(
    at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.validateVersion(
    at org.openstreetmap.osmosis.apidb.v0_6.ApidbReader.runImpl(
    at org.openstreetmap.osmosis.apidb.v0_6.ApidbReader$1.doInTransactionWithoutResult(
    at org.openstreetmap.osmosis.apidb.common.DatabaseContext2.executeWithinTransaction(

One Answer

The error message already includes the solution:

may need to upgrade osmosis or specify validateSchemaVersion=no

You need to add this paarameter+value as option next to the --read-apidb parameter when calling osmosis. See

Correct answer by mmd on January 2, 2021

Add your own answers!

Related Questions

Finding points along line closest to known point

1  Asked on April 21, 2021 by henrik-lied


Implementing QgsTasks in a Plugin

0  Asked on April 21, 2021


Intersect points and polygons

1  Asked on April 21, 2021 by tnt


QGIS link to web server

0  Asked on April 21, 2021


Change rasters’ z value to minus (Below sealeave)

1  Asked on April 20, 2021 by communityecologist


Combining Layers by Weighting Attributes

0  Asked on April 20, 2021 by cole


Why can QGIS open MrSid files, but GDAL cannot?

1  Asked on April 20, 2021 by maxfield-green


Semi-Automatic Classification Plugin error

0  Asked on April 20, 2021 by yu-lan


Ask a Question

Get help from others!

© 2022 All rights reserved.