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(SchemaVersionValidator.java:118)
at org.openstreetmap.osmosis.apidb.v0_6.impl.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:53)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbReader.runImpl(ApidbReader.java:74)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbReader$1.doInTransactionWithoutResult(ApidbReader.java:102)
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:34)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.openstreetmap.osmosis.apidb.common.DatabaseContext2.executeWithinTransaction(DatabaseContext2.java:94)
at org.openstreetmap.osmosis.apidb.v0_6.ApidbReader.run(ApidbReader.java:99)
at java.lang.Thread.run(Thread.java:748)