Upgrade the Evergreen database schema

The upgrade of the Evergreen database schema is the lengthiest part of the upgrade process for sites with a significant amount of production data.

Before running the upgrade script against your production Evergreen database, back up your database, restore it to a test server, and run the upgrade script against the test server. This enables you to determine how long the upgrade will take and whether any local customizations present problems for the stock upgrade script that require further tailoring of the upgrade script. The backup also enables you to cleanly restore your production data if anything goes wrong during the upgrade.

Note

Evergreen provides incremental upgrade scripts that allow you to upgrade from one minor version to the next until you have the current version of the schema. For example, if you want to upgrade from 2.7.0 to 3.0.5, you would run the following upgrade scripts:

  • 2.7.0-2.7.1-upgrade-db.sql
  • 2.7.1-2.7.2-upgrade-db.sql
  • 2.7.2-2.7.3-upgrade-db.sql
  • 2.7.3-2.7.4-upgrade-db.sql
  • 2.7.4-2.8.0-upgrade-db.sql (this is a major version upgrade)
  • 2.8.0-2.8.1-upgrade-db.sql
  • 2.8.1-2.8.2-upgrade-db.sql
  • 2.8.2-2.8.3-upgrade-db.sql
  • 2.8.3-2.8.4-upgrade-db.sql
  • 2.8.4-2.9.0-upgrade-db.sql (this is a major version upgrade)
  • 2.9.0-2.9.1-upgrade-db.sql
  • 2.9.1-2.9.2-upgrade-db.sql
  • 2.9.2-2.9.3-upgrade-db.sql
  • 2.9.3-2.10.0-upgrade-db.sql (this is a major version upgrade)
  • 2.10.0-2.10.1-upgrade-db.sql
  • 2.10.1-2.10.2-upgrade-db.sql
  • 2.10.2-2.10.3-upgrade-db.sql
  • 2.10.3-2.10.4-upgrade-db.sql
  • 2.10.4-2.10.5-upgrade-db.sql
  • 2.10.5-2.10.6-upgrade-db.sql
  • 2.10.6-2.10.7-upgrade-db.sql
  • 2.10.7-2.11.0-upgrade-db.sql (this is a major version upgrade)
  • 2.11.0-2.11.1-upgrade-db.sql
  • 2.11.1-2.11.2-upgrade-db.sql
  • 2.11.2-2.11.3-upgrade-db.sql
  • 2.11.3-2.12.0-upgrade-db.sql (this is a major version upgrade)
  • 2.12.0-2.12.1-upgrade-db.sql
  • 2.12.1-2.12.2-upgrade-db.sql
  • 2.12.2-2.12.3-upgrade-db.sql
  • 2.12.3-2.12.4-upgrade-db.sql
  • 2.12.4-2.12.5-upgrade-db.sql
  • 2.12.5-2.12.6-upgrade-db.sql
  • 2.12.6-3.0.0-upgrade-db.sql (this is a major version upgrade)
  • 3.0.0-3.0.1-upgrade-db.sql
  • 3.0.1-3.0.2-upgrade-db.sql
  • 3.0.2-3.0.3-upgrade-db.sql
  • 3.0.3-3.0.4-upgrade-db.sql
  • 3.0.4-3.0.5-upgrade-db.sql

Note that you do not want to run additional 2.7 scripts to upgrade to the newest version of 2.7, since currently there is no automated way to upgrade from 2.7.5+ to 2.8. Only upgrade as far as necessary to reach the major version upgrade script (in this example, as far as 2.7.4).

Caution

Pay attention to error output as you run the upgrade scripts. If you encounter errors that you cannot resolve yourself through additional troubleshooting, please report the errors to the Evergreen Technical Discussion List.

Run the following steps (including other upgrade scripts, as noted above) as a user with the ability to connect to the database server.

cd /home/opensrf/Evergreen-ILS-3.0.5/Open-ILS/src/sql/Pg
psql -U evergreen -h localhost -f version-upgrade/3.0.3-3.0.4-upgrade-db.sql evergreen

Tip

After the some database upgrade scripts finish, you may see a note on how to reingest your bib records. You may run this after you have completed the entire upgrade and tested your system. Reingesting records may take a long time depending on the number of bib records in your system.