This section discusses how to migrate your database data from one
EnterpriseDB release to a newer one.
The software installation procedure per se is not the
subject of this section.
As a general rule, the internal data storage format is subject to
change between major releases of EnterpriseDB (where
the number after the first dot changes). This does not apply to
different minor releases under the same major release (where the
number after the second dot changes); these typically have compatible
storage formats.
When you update between compatible versions, you can simply install the new
version of EnterpriseDB and start up the edb-postmaster
program pointing to the existing data directory on disk. Otherwise, in order to perform
the proper transformation to a new data storage format you need to back up your data
and restore it on the new server. This has to be done using pg_dump
or pg_dumpall; file system level backup methods obviously won't work.
You should use the pg_dump and pg_dumpall programs
from the newer version of EnterpriseDB to dump the data from your
current database to take advantage of any enhancements that may have been made in these programs.
In general, the following are the steps to perform the migration.
Make a Backup.
Always make sure you have a backup of your existing databases in case you
have to revert back to your original databases for some reason.
Install EnterpriseDB.
Install the new version of EnterpriseDB into a new directory location
and create a new database cluster in a new directory location. If using the installer,
the old version of EnterpriseDB should be left running when the installation is done
so the installer will automatically assign a new port number to the new database cluster.
Create a Dump File.
Run the pg_dump or pg_dumpall programs from the new version of EnterpriseDB to connect
to the old database cluster and create a dump file of the database(s) that you wish to migrate.
Restore the Dump File.
Use the edb-psql program from the new version of EnterpriseDB to re-create the databases
in the new EnterpriseDB database cluster from the dump file.
The example below makes the following assumptions:
The old version of EnterpriseDB is installed in location /opt/edb-2005/old-release.
The old database cluster is running on port 5444.
The new version of EnterpriseDB has been installed in location /opt/edb-2005/new-release.
The new database cluster is running on port 5445.
enterprisedb is the superuser in both the old and new database clusters.
cd /opt/edb-2005/new-release/dbserver/bin
./pg_dumpall -U enterprisedb -p 5444 > /tmp/backup.dump
./edb-psql -d template1 -U enterprisedb -p 5445 < /tmp/backup.dump
You should make sure that the old database is not updated
after you run pg_dumpall, otherwise you will obviously
lose that data. See Chapter 33 for information
on how to prohibit access.
Be sure to test your client applications on the new setup before switching over completely.
This is another reason for setting up concurrent installations of old and new versions.