Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Overview of this book

Table of Contents (19 chapters)
PostgreSQL 9 Administration Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Major upgrades online


Upgrading between major releases is hard, and it should be deferred until you have some good reasons and sufficient time to get it right.

You can use replication tools to minimize the downtime required for an upgrade, so we refer to this recipe as online upgrade.

How to do it…

The following general steps should be followed, allowing at least a month for the complete process to ensure that everything is tested and everybody understands the implications:

  1. Set up a new release of the software on a new test system.

  2. Take a standalone backup from the main system and copy it to the test system. Test the applications extensively against the new release on the test system.

  3. When everything works and performs correctly, then do the following:

    1. Set up a connection pooler to the main database (it may be there already).

    2. Set up replication using Londiste or Slony on the new system, if upgrading to 9.4. If upgrading to PostgreSQL 9.5 or a later release, use Logical Replication.

    3. Retest the application...