Changeset bcdfc53


Ignore:
Timestamp:
12/04/2021 11:16:54 AM (10 months ago)
Author:
Thomas Trepl (Moody) <thomas@…>
Branches:
11.1, 11.2, lazarus, trunk, upgradedb, xry111/intltool, xry111/soup3, xry111/test-20220226
Children:
7f6bf79b
Parents:
edd2feb7
Message:

Add some notes about upgrading DBMS

Location:
server/databases
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • server/databases/databases.xml

    redd2feb7 rbcdfc53  
    1919  </para>
    2020
     21  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="upgradedb.xml"/>
     22
    2123  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="db.xml"/>
    2224  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="lmdb.xml"/>
  • server/databases/postgresql.xml

    redd2feb7 rbcdfc53  
    167167    </para>
    168168
     169    <note>
     170      <para>Hold off from continuing in case you are building
     171      <application>PostgreSQL</application> to upgrade an existing
     172      installation. In case the major version of the new build is
     173      different to the existing one, its quite likely that the
     174      new software cannot act on the existing data files. In this case,
     175      the server will not start and the old binaries has been overwritten
     176      so you got stuck with an unusable database.</para>
     177      <para>At this moment, you have both, the old and the new binaries
     178      on disk. They can be used to perform an upgrade of your existing
     179      database right now. For the folloging instructions it is
     180      assumed that
     181      <itemizedlist>
     182        <listitem><para>The actual data files are stored in
     183          <filename class="directory">/srv/pgsql/data</filename></para>
     184        </listitem>
     185        <listitem><para>The upgraded data files will be stored in
     186          <filename class="directory">/srv/pgsql/newdata</filename></para>
     187        </listitem>
     188        <listitem><para>There is enough disk space to hold the actual
     189          data files twice. The upgrade is not an inline upgrade but
     190          it will copy the data to new database files.</para>
     191        </listitem>
     192      </itemizedlist>
     193      </para>
     194
     195      <para>Do a temporary install which makes access to the new
     196      binaries a bit easier:</para>
     197      <screen><userinput>make DESTDIR=$(pwd)/DESTDIR install</userinput></screen>
     198
     199      <para>Create a directory which is writable by the
     200      <systemitem class="username">postgres</systemitem> as the
     201      <systemitem class="username">root</systemitem> user:</para>
     202     
     203      <screen><userinput role="root">install -D -o postgres $(pwd)/DESTDIR/tmp</userinput></screen>
     204     
     205      <para>Now, stop the existing instance of <application>PostgreSQL</application>
     206      and start the upgrade process as the
     207      <systemitem class="username">root</systemitem> user:</para>
     208     
     209      <screen><userinput role="root">pushd $(pwd)/DESTDIR/tmp
     210/etc/rc.d/init.d/postgresql stop
     211su postgres -c "../usr/bin/initdb -D /srv/pgsql/newdata"
     212su postgres -c "../usr/bin/pg_upgrade -d /srv/pgsql/data -D /srv/pgsql/newdata -b /usr/bin -B ../usr/bin"
     213popd</userinput></screen>
     214     
     215      <para>At this stage, you have your database files two times on
     216      disk, one is the old data in <filename class="directory">/srv/pgsql/data</filename>
     217      and the new ones in <filename class="directory">/srv/pgsql/newdata</filename>.
     218      May this is the time you do a last backup of the old database files.</para>
     219     
     220      <para>Remove the old database files, and rename the new data
     221      directory as the <systemitem class="username">root</systemitem> user:</para>
     222     
     223      <screen><userinput role="root">rm -rf /srv/pgsql/data
     224mv /srv/pgsql/newdata /srv/pgsql/data</userinput></screen>
     225
     226    </note>
     227   
    169228    <para>
    170229      Now, as the <systemitem class="username">root</systemitem> user:
     
    188247      </para>
    189248    </tip>
     249
     250    <para>
     251      If you have upgraded an existing database, skip the rest of the
     252      commands because your database is ready to use. If this is the
     253      first time you install <application>PostgreSQL</application>,
     254      continue with the initialization.
     255    </para>
    190256
    191257    <para>
Note: See TracChangeset for help on using the changeset viewer.