diff options
Diffstat (limited to 'doc/src/sgml/pgupgrade.sgml')
-rw-r--r-- | doc/src/sgml/pgupgrade.sgml | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/doc/src/sgml/pgupgrade.sgml b/doc/src/sgml/pgupgrade.sgml index 9081cc916ae..15bba6eaf17 100644 --- a/doc/src/sgml/pgupgrade.sgml +++ b/doc/src/sgml/pgupgrade.sgml @@ -148,57 +148,57 @@ <procedure> <step performance="optional"> <title>Optionally move the old cluster</title> - + <para> If you are using a version-specific installation directory, e.g. <filename>/opt/PostgreSQL/8.4</>, you do not need to move the old cluster. The one-click installers all use version-specific installation directories. </para> - - <para> + + <para> If your installation directory is not version-specific, e.g. <filename>/usr/local/pgsql</>, it is necessary to move the current PostgreSQL install directory so it does not interfere with the new <productname>PostgreSQL</> installation. Once the current <productname>PostgreSQL</> server is shut down, it is safe to rename the PostgreSQL installation directory; assuming the old directory is <filename>/usr/local/pgsql</>, you can do: - + <programlisting> mv /usr/local/pgsql /usr/local/pgsql.old </programlisting> to rename the directory. </para> </step> - + <step> <title>For source installs, build the new version</title> - + <para> Build the new PostgreSQL source with <command>configure</> flags that are compatible with the old cluster. <application>pg_upgrade</> will check <command>pg_controldata</> to make sure all settings are compatible before starting the upgrade. </para> </step> - + <step> <title>Install the new PostgreSQL binaries</title> - + <para> Install the new server's binaries and support files. You can use the same port numbers for both clusters, typically 5432, because the old and new clusters will not be running at the same time. </para> - + <para> For source installs, if you wish to install the new server in a custom location, use the <literal>prefix</literal> variable: - + <programlisting> gmake prefix=/usr/local/pgsql.new install </programlisting> </para> </step> - + <step> <title>Install pg_upgrade and pg_upgrade_support</title> @@ -207,10 +207,10 @@ gmake prefix=/usr/local/pgsql.new install <application>pg_upgrade_support</> in the new PostgreSQL cluster </para> </step> - + <step> <title>Initialize the new PostgreSQL cluster</title> - + <para> Initialize the new cluster using <command>initdb</command>. Again, use compatible <command>initdb</command> @@ -219,10 +219,10 @@ gmake prefix=/usr/local/pgsql.new install start the new cluster. </para> </step> - + <step> <title>Install custom shared object files</title> - + <para> Install any custom shared object files (or DLLs) used by the old cluster into the new cluster, e.g. <filename>pgcrypto.so</filename>, whether they are from <filename>contrib</filename> @@ -230,10 +230,10 @@ gmake prefix=/usr/local/pgsql.new install <filename>pgcrypto.sql</>, because these will be migrated from the old cluster. </para> </step> - + <step> <title>Adjust authentication</title> - + <para> <command>pg_upgrade</> will connect to the old and new servers several times, so you might want to set authentication to <literal>trust</> in @@ -242,36 +242,36 @@ gmake prefix=/usr/local/pgsql.new install to avoid being prompted repeatedly for a password. </para> </step> - + <step> <title>Stop both servers</title> - + <para> Make sure both database servers are stopped using, on Unix, e.g.: - + <programlisting> pg_ctl -D /opt/PostgreSQL/8.4 stop pg_ctl -D /opt/PostgreSQL/9.0 stop </programlisting> - + or on Windows, using the proper service names: - + <programlisting> NET STOP postgresql-8.4 NET STOP postgresql-9.0 </programlisting> - + or - + <programlisting> NET STOP pgsql-8.3 (<productname>PostgreSQL</> 8.3 and older used a different service name) </programlisting> </para> </step> - + <step> <title>Run <application>pg_upgrade</></title> - + <para> Always run the <application>pg_upgrade</> binary of the new server, not the old one. <application>pg_upgrade</> requires the specification of the old and new cluster's @@ -282,18 +282,18 @@ NET STOP pgsql-8.3 (<productname>PostgreSQL</> 8.3 and older used a different s old cluster once you start the new cluster after the upgrade. See <literal>pg_upgrade --help</> for a full list of options. </para> - + <para> For Windows users, you must be logged into an administrative account, and then start a shell as the <literal>postgres</> user and set the proper path: - + <programlisting> RUNAS /USER:postgres "CMD.EXE" SET PATH=%PATH%;C:\Program Files\PostgreSQL\9.0\bin; </programlisting> - + and then run <application>pg_upgrade</> with quoted directories, e.g.: - + <programlisting> pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/8.4/data" @@ -301,7 +301,7 @@ pg_upgrade.exe --old-bindir "C:/Program Files/PostgreSQL/8.4/bin" --new-bindir "C:/Program Files/PostgreSQL/9.0/bin" </programlisting> - + Once started, <command>pg_upgrade</> will verify the two clusters are compatible and then do the migration. You can use <command>pg_upgrade --check</> to perform only the checks, even if the old server is still @@ -309,11 +309,11 @@ pg_upgrade.exe manual adjustments you will need to make after the migration. <command>pg_upgrade</> requires write permission in the current directory. </para> - + <para> Obviously, no one should be accessing the clusters during the migration. </para> - + <para> If an error occurs while restoring the database schema, <command>pg_upgrade</> will exit and you will have to revert to the old cluster as outlined in <xref linkend="pgupgrade-step-revert"> @@ -324,35 +324,35 @@ pg_upgrade.exe assuming the module is not being used to store user data. </para> </step> - + <step> <title>Restore <filename>pg_hba.conf</></title> - + <para> If you modified <filename>pg_hba.conf</> to use <literal>trust</>, restore its original authentication settings. </para> </step> - + <step> <title>Post-migration processing</title> - + <para> If any post-migration processing is required, pg_upgrade will issue warnings as it completes. It will also generate script files that must be run by the administrator. The script files will connect to each database that needs post-migration processing. Each script should be run using: - + <programlisting> psql --username postgres --file script.sql postgres </programlisting> - + The scripts can be run in any order and can be deleted once they have been run. </para> - <caution> + <caution> <para> In general it is unsafe to access tables referenced in rebuild scripts until the rebuild scripts have run to completion; doing so could yield @@ -361,7 +361,7 @@ psql --username postgres --file script.sql postgres </para> </caution> </step> - + <step> <title>Statistics</title> @@ -371,10 +371,10 @@ psql --username postgres --file script.sql postgres of the migration. </para> </step> - + <step> <title>Delete old cluster</title> - + <para> Once you are satisfied with the upgrade, you can delete the old cluster's data directories by running the script mentioned when @@ -383,10 +383,10 @@ psql --username postgres --file script.sql postgres (e.g. <filename>bin</>, <filename>share</>). </para> </step> - + <step id="pgupgrade-step-revert" performance="optional"> <title>Reverting to old cluster</title> - + <para> If, after running <command>pg_upgrade</command>, you wish to revert to the old cluster, there are several options: @@ -430,12 +430,12 @@ psql --username postgres --file script.sql postgres </para> </step> </procedure> - + </sect2> - + <sect2> <title>Limitations in Migrating <emphasis>from</> PostgreSQL 8.3</title> - + <para> Upgrading from PostgreSQL 8.3 has additional restrictions not present when upgrading from later PostgreSQL releases. For example, @@ -458,7 +458,7 @@ psql --username postgres --file script.sql postgres <para> You must drop any such columns and migrate them manually. </para> - + <para> pg_upgrade will require a table rebuild if: <itemizedlist> @@ -469,7 +469,7 @@ psql --username postgres --file script.sql postgres </listitem> </itemizedlist> </para> - + <para> pg_upgrade will require a reindex if: <itemizedlist> @@ -485,14 +485,14 @@ psql --username postgres --file script.sql postgres </listitem> </itemizedlist> </para> - + <para> Also, the default datetime storage format changed to integer after <productname>PostgreSQL</> 8.3. pg_upgrade will check that the datetime storage format used by the old and new clusters match. Make sure your new cluster is built with the configure flag <option>--disable-integer-datetimes</>. </para> - + <para> For Windows users, note that due to different integer datetimes settings used by the one-click installer and the MSI installer, it is only @@ -502,31 +502,31 @@ psql --username postgres --file script.sql postgres </para> </sect2> - + <sect2> <title>Notes</title> - - <para> + + <para> <application>pg_upgrade</> does not support migration of databases containing these <type>reg*</> OID-referencing system data types: <type>regproc</>, <type>regprocedure</>, <type>regoper</>, <type>regoperator</>, <type>regclass</>, <type>regconfig</>, and <type>regdictionary</>. (<type>regtype</> can be migrated.) </para> - - <para> + + <para> All failure, rebuild, and reindex cases will be reported by <application>pg_upgrade</> if they affect your installation; post-migration scripts to rebuild tables and indexes will be generated automatically. </para> - + <para> For deployment testing, create a schema-only copy of the old cluster, insert dummy data, and migrate that. </para> - - <para> + + <para> If you want to use link mode and you don't want your old cluster to be modified when the new cluster is started, make a copy of the old cluster and migrate that with link mode. To make a valid copy @@ -535,7 +535,7 @@ psql --username postgres --file script.sql postgres the old server and run <command>rsync</> again to update the copy with any changes to make it consistent. </para> - + </sect2> - + </sect1> |