Changeset 60351e5b
- Timestamp:
- 12/16/2021 08:28:05 PM (2 years ago)
- Branches:
- 11.1, 11.2, 11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- bc9c5251
- Parents:
- 0ed6f34
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/databases/postgresql.xml
r0ed6f34 r60351e5b 157 157 158 158 <note> 159 <para> Hold off from continuing in case you are building160 <application>PostgreSQL</application> to upgrade an existing161 installation. In case the major version of the new build is162 different to the existing one, its quite likely that the163 new software cannot act on the existing data files. In this case, 164 the server will not start and the old binaries has been overwritten165 so you got stuck with an unusable database.</para>159 <para>If you are installing <application>PostgreSQL</application> to 160 upgrade an existing installation, there are important steps that you need 161 to follow. If the major version of the new build is greater than the 162 previous version, there is a chance that the data file format has changed. 163 new software cannot act on the existing data files. In this case, the 164 server will not start because the old programs have been overwritten, so 165 the data is unavailable until it's file format has been converted.</para> 166 166 167 167 <para> 168 Before upgrading an existing installation of PostgreSQL check 169 the documentation about various ways to upgrade. Note that 170 new major versions might use a different binary format in the 171 data objects in which case incompatibilities may be introduced. 172 Find the documentation about upgrading at 168 Before upgrading an existing installation of PostgreSQL, check 169 the documentation for any considerations that you must keep in mind 170 during the upgrade. Note that new major versions might use a different 171 binary format in the data objects, causing potential incompatibilities. 172 For more information, check out upstream's documentation about 173 upgrading PostgreSQL here. 173 174 <ulink url="https://www.postgresql.org/docs/current/upgrading.html"/>. 174 175 </para> 175 176 176 <para>At this moment, you have both,the old and the new binaries177 on disk. They can be used to perform an upgrade of your existing178 database right now. For the folloging instructions it is179 assumed that177 <para>At this point, you may have both the old and the new binaries 178 installed on your filesystem. These binaries can be used to perform an 179 upgrade of your existing database files. For the following instructions 180 it is assumed that 180 181 <itemizedlist> 181 182 <listitem><para>The actual data files are stored in … … 192 193 </para> 193 194 194 <para> Do a temporary install which makes access to the new195 binaries a biteasier:</para>196 197 198 <para> Create a directory which is writable by the199 <systemitem class="username">postgres</systemitem> as the195 <para>Fist, do a temporary install which makes access to the new 196 binaries much easier:</para> 197 <screen><userinput>make DESTDIR=$(pwd)/DESTDIR install</userinput></screen> 198 199 <para>Next, create a directory which is writable by the 200 <systemitem class="username">postgres</systemitem> user, as the 200 201 <systemitem class="username">root</systemitem> user:</para> 201 202 202 203 <screen><userinput role="root">install -D -o postgres $(pwd)/DESTDIR/tmp</userinput></screen> 203 204 204 205 <para>Now, stop the existing instance of <application>PostgreSQL</application> … … 206 207 <systemitem class="username">root</systemitem> user:</para> 207 208 208 <screen><userinput role="root">pushd $(pwd)/DESTDIR/tmp209 <screen revision="sysv"><userinput role="root">pushd $(pwd)/DESTDIR/tmp 209 210 /etc/rc.d/init.d/postgresql stop 210 211 su postgres -c "../usr/bin/initdb -D /srv/pgsql/newdata" … … 213 214 -D /srv/pgsql/newdata -B ../usr/bin" 214 215 popd</userinput></screen> 216 217 <screen revision="systemd"><userinput role="root">pushd $(pwd)/DESTDIR/tmp 218 systemctl stop postgresql 219 su postgres -c "../usr/bin/initdb -D /srv/pgsql/newdata" 220 su postgres -c "../usr/bin/pg_upgrade \ 221 -d /srv/pgsql/data -b /usr/bin \ 222 -D /srv/pgsql/newdata -B ../usr/bin" 223 popd</userinput></screen> 224 225 <para>At this point, your database files available in two locations on 226 disk. The old data is located in 227 <filename class="directory">/srv/pgsql/data</filename>, and the new data 228 is in <filename class="directory">/srv/pgsql/newdata</filename>. 229 Backing up the old database files is suggested before continuing.</para> 215 230 216 <para>At this stage, you have your database files two times on 217 disk, one is the old data in <filename class="directory">/srv/pgsql/data</filename> 218 and the new ones in <filename class="directory">/srv/pgsql/newdata</filename>. 219 May this is the time you do a last backup of the old database files.</para> 220 221 <para>Remove the old database files, and rename the new data 231 <para>Next, remove the old database files, and rename the new data 222 232 directory as the <systemitem class="username">root</systemitem> user:</para> 223 233 224 234 <screen><userinput role="root">rm -rf /srv/pgsql/data 225 235 mv /srv/pgsql/newdata /srv/pgsql/data</userinput></screen> 226 236
Note:
See TracChangeset
for help on using the changeset viewer.