8.3 migrate_postgresql_database

The migrate_postgresql_database helps with upgrade of PostgreSQL database from version 8 to 9. You usually need to run it only once per SLMS site after the upgrade of SLMS itself (see Section 2.2, Upgrade from SLMS 1.2). Both—the old and the new— versions of PostgreSQL servers must be already installed in the system.


migrate_postgresql_database options

The command understands the following options:

-h or --help

Prints useful information on the command's usage.

--file dump_file

Specifies the path to a temporary dump file (/var/lib/slms/slms_db_export.sql.gz by default). If a file of the identical name exists, it is renamed before the new dump is created (time stamp suffix is added). Use together with --dump-only and --restore-only options.

-k or --keep-dump

Leaves the dump of the old-format database on the file system. By default, the dump file is removed after successful upgrade.

-b or --keep-db

Leaves the old-format subdirectory tree on the file system. By default the old database files are removed after successful upgrade.

-c or --clear

Adds the clear commands to the database dump to clear the old data when restoring a database (not used by default, a new empty database is created at restore time, so this should not be needed).

-f or --force

Forces the database migration even if the latest PostgreSQL database is already running.

-d or --dump-only

Only performs a dump of the current database to a file specified with --file.

-r or --restore-only

Only restores the database from a dump file (created with --dump-only) specified with --file.