blob: 78f67cb9a4ac1ebe736a8d3f233e51a20ede6138 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/Attic/pg_upgrade.sgml,v 1.5 1999/07/22 15:09:13 thomas Exp $
Postgres documentation
-->
<refentry id="APP-PG-UPGRADE">
<refmeta>
<refentrytitle id="APP-PG-UPGRADE-TITLE">
<application>pg_upgrade</application>
</refentrytitle>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
<refnamediv>
<refname>
<application>pg_upgrade</application>
</refname>
<refpurpose>
Allows upgrade from a previous release without reloading data
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<refsynopsisdivinfo>
<date>1999-07-20</date>
</refsynopsisdivinfo>
<synopsis>
pg_upgrade
pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replaceable class="parameter">old_data_dir</replaceable>
</synopsis>
</refsynopsisdiv>
<refsect1 id="R1-APP-PG-UPGRADE-1">
<refsect1info>
<date>1998-10-04</date>
</refsect1info>
<title>
Description
</title>
<para>
<application>pg_upgrade</application>
is a utility for upgrading from a previous
PostgreSQL release without reloading all the data.
Not all <productname>Postgres</productname> releases can be handled
this way; check the release notes for details on your installation.
</para>
<procedure>
<title>Upgrading <productname>Postgres</productname></title>
<step performance="required">
<para>
Back up your data directory.
</para>
</step>
<step performance="required">
<para>
Use:
<programlisting>
% pg_dumpall -s >db.out
</programlisting>
to dump out your old database definitions without any
data. Stop the postmaster and all backends.
</para>
</step>
<step performance="required">
<para>
Rename (using mv) your old pgsql <filename>data/</filename> directory to
<filename>data.old/</filename>.
</para>
</step>
<step performance="required">
<para>
Do a
<command>make install</command> to install the new binaries.
</para>
</step>
<step performance="required">
<para>
Run <application>initdb</application> to create a new template1 database containing the system
tables for the new release.
</para>
</step>
<step performance="required">
<para>
Start the new postmaster.
</para>
</step>
<step performance="required">
<para>
Change your working directory to the
pgsql main directory, and type:
<programlisting>
% pg_upgrade -f db.out data.old
</programlisting>
The system will do some checking to make sure everything
is properly configured, and will run your db.out script to create
all the databases and tables you had, but with no
data. It will then move the data files from <filename>data.old/</filename>
into the proper <filename>data/</filename> directory.
</para>
</step>
<step performance="required">
<para>
<emphasis>Carefully</emphasis> examine the contents of the upgraded database.
</para>
</step>
<step performance="required">
<para>
You can delete the <filename>data.old/</filename> directory when you
are finished.
</para>
</step>
</procedure>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->
|