osm2pgsql-replication(1)

NAME
osm2pgsql-replication

SYNOPSIS
osm2pgsql-replication [-h] {init,update} ...

DESCRIPTION
Update an osm2pgsql database with changes from a OSM replication server.
This tool initialises the updating process by looking at the import file
or the newest object in the database. The state is then saved in a table
in the database. Subsequent runs download newly available data and apply
it to the database.
See the help of the 'init' and 'update' command for more information on
how to use osm2pgsql-replication.

OPTIONS

  Sub-commands

osm2pgsql-replication init
        Initialise the replication process.

osm2pgsql-replication update
        Download newly available data and apply it to the database.

OPTIONS 'osm2pgsql-replication init'
usage: osm2pgsql-replication init [-h] [-q] [-v] [-d DB] [-U NAME] [-H HOST]
                        [-P PORT] [--prefix PREFIX]
                        [--osm-file FILE | --server URL] Initialise the replication process.
There are two ways to initialise the replication process: if you have imported
from a file that contains replication source information, then the
initialisation process can use this and set up replication from there.
Use the command '%(prog)s --osm-file <filename>' for this.
If the file has no replication information or you don't have the initial
import file anymore then replication can be set up according to
the data found in the database. It checks the planet_osm_way table for the
newest way in the database and then queries the OSM API when the way was
created. The date is used as the start date for replication. In this mode
the minutely diffs from the OSM servers are used as a source. You can change
this with the '--server' parameter.

-q, --quiet
    Print only error messages

-v, --verbose
    Increase verboseness of output

-d DB, --database DB
    Name of PostgreSQL database to connect to or conninfo string

-U NAME, --username NAME
    PostgreSQL user name

-H HOST, --host HOST
    Database server host name or socket location

-P PORT, --port PORT
    Database server port

--prefix PREFIX
    Prefix for table names (default 'planet_osm')

--osm-file FILE
    Get replication information from the given file.

--server URL
    Use replication server at the given URL (default: https://planet.openstreetmap.org/replication/minute)

OPTIONS 'osm2pgsql-replication update'
usage: osm2pgsql-replication update update [options] [-- param [param ...]] Download newly available data and apply it to the database.
The data is downloaded in chunks of '--max-diff-size' MB. Each chunk is
saved in a temporary file and imported with osm2pgsql from there. The
temporary file is normally deleted afterwards unless you state an explicit
location with '--diff-file'. Once the database is up to date with the
replication source, the update process exits with 0.
Any additional arguments to osm2pgsql need to be given after '--'. Database
and the prefix parameter are handed through to osm2pgsql. They do not need
to be repeated. '--append' and '--slim' will always be added as well.

param
    Extra parameters to hand in to osm2pgsql.

--diff-file FILE
    File to save changes before they are applied to osm2pgsql.

--max-diff-size MAX_DIFF_SIZE
    Maximum data to load in MB (default: 500MB)

--osm2pgsql-cmd OSM2PGSQL_CMD
    Path to osm2pgsql command (default: osm2pgsql)

--once
    Run updates only once, even when more data is available.

-q, --quiet
    Print only error messages

-v, --verbose
    Increase verboseness of output

-d DB, --database DB
    Name of PostgreSQL database to connect to or conninfo string

-U NAME, --username NAME
    PostgreSQL user name

-H HOST, --host HOST
    Database server host name or socket location

-P PORT, --port PORT
    Database server port

--prefix PREFIX
    Prefix for table names (default 'planet_osm')

DISTRIBUTION
The latest version of osm2pgsql-replication may be downloaded from <<UNSET