Changeset fe9a4337


Ignore:
Timestamp:
10/22/2022 06:37:31 PM (18 months ago)
Author:
David Bryant <davidbryant@…>
Branches:
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/llvm18, xry111/xf86-video-removal
Children:
69d5316
Parents:
736a977
Message:

Edited for grammar, idiom, and style. Notice that "backup" is a noun,
and "back up" is a verb. Adjusted capitalization in titles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/databases/upgradedb.xml

    r736a977 rfe9a4337  
    1313  </sect1info>
    1414
    15   <title>Important notes about upgrading Database Server Software</title>
     15  <title>Important Notes About Upgrading Database Server Software</title>
    1616
    1717    <note><para>This section is about reinstalling database software
     
    2121    to become aware of issues that can arise in the future.</para></note>
    2222
    23     <para>Lets start this chapter with a dramatic screenshot of an issue that
    24     really happened.  This issue will not occur if you are going to install the
    25     software the first time:</para>
     23    <para>Let's start this chapter with a dramatic screenshot of an error that
     24    really happened.  This error will not occur if you are installing database
     25    software for the first time:</para>
    2626
    2727<screen>$ sudo systemctl status postgresql
     
    4545
    4646  <para>
    47     To avoid situations like the one above finding your database server
    48     software refusing to start, read the following thoughts about how to
    49     upgrade a DBMS (Database Management System) prior to actually doing the
    50     upgrade.
     47    To avoid situations like this (i.e., your database server
     48    software refuses to start), read the following discussion of the best way to
     49    upgrade a DBMS (Database Management System).
    5150  </para>
    5251
    5352  <para>
    54     The root cause of the issue shown above was an upgrade
    55     of the server software to a newer major version but leaving the
    56     data files untouched. The administrator was able to recover without any
    57     loss of data.
     53    The root cause of the error shown above was an upgrade
     54    of the server software to a newer major version which left the
     55    data files untouched. In this case, the administrator was able to recover
     56    the DBMS without any loss of data.
    5857  </para>
    5958
    6059  <para>
    61     Even if you are doing an install DBMS install, read through this
    62     section. Tt will provide you information about how to set up backup
    63     and restore procedures (at least the strategy for building
    64     them) which are sufficient for your needs and for the safety
     60    Even if you are doing an initiall DBMS install, read through this
     61    section. It provides information about implementing backup
     62    and restore procedures (or at least a strategy for creating
     63    them) which will satisfy your needs and guarantee the safety
    6564    of your data.
    6665  </para>
    6766
    6867  <sect2>
    69     <title>Upgrade database server packages</title>
     68    <title>Upgrade Database Server Packages</title>
    7069
    7170    <para>
    7271      Database systems work on files which hold the database metadata and the
    73       data itself. Those files are highly optimized in their internal
    74       structures for use by the server software. When upgrading such server
    75       software, newer server software may expect a different file format than
    76       was created by previous versions. In the best case, the new software can
    77       act on the old format as well&mdash;but not benefitting from newer
    78       formats which might result in better performance or of other
    79       improvements.  It can also happen that the new server software will
    80       reformat the data files automatically when starting.
     72      data itself. The internal structure of these files is optimized for use
     73      by the server software. When such server software is upgraded,
     74      the new software may utilize a different file format than
     75      had previously been used. Sometimes the new software can
     76      work with the old format as well as the new one&mdash;but wiithout the
     77      performance improvements the new format provides.
     78      Other times, the new server software will
     79      reformat the data files automatically after the upgrade.
    8180    </para>
    8281
    8382    <para>
    8483      Unfortunately, the most likely case is that the new server software
    85       complains about out of date file formats and exits.  When this happens
    86       and you have overwritten the installed server software, you may not be
    87       able to read the data files and the new software is unwilling to do so.
    88     </para>
    89 
    90     <para>
    91        Changes in data file formats usually happen at major version changes but
    92        potentially can come at other times.  Before upgrading the server
    93        software, check the documentation if there are changes which will
     84      complains about out of date file formats and exits.  When this happens,
     85      and you have overwritten the old server software, you may end up
     86      with a broken system and lost data.
     87    </para>
     88
     89    <para>
     90       Changes in data file formats usually happen at major version changes, but
     91       they can also occur at other times.  Before upgrading any DBMS
     92       software, check the documentation to see if this upgrade makes changes which
    9493       require reformatting the database.
    9594    </para>
    9695
    9796    <para>
    98       Of course, if you have databases with content which is not easy to
    99       rebuild, it is always a good idea to create backups of the database from
    100       time to time. When upgrading the server software, it is time to run
     97      Of course, if you have databases with content that is not easily
     98      rebuilt, it is always a good idea to create backups of the database from
     99      time to time. Before upgrading the server software, you should run
    101100      another backup.
    102101    </para>
    103102
    104103    <sect3>
    105       <title>Upgrade by backup and restore</title>
     104      <title>Upgrade by Backup and Restore</title>
    106105
    107106      <note>
    108107        <para>
    109           A backup is meaningless if there is no verified process
     108          A backup is useless if there is no verified process
    110109          to restore the data from this backup. When running a
    111           database server, you should not only create backups but you
    112           should also verify that the process you designed to fulfill
    113           the restore task is working properly. When you encounter a
    114           problem with the restore when you urgently have to
    115           rely on the backup data, it is too late&mdash;your database is
    116           in danger.
     110          database server, you should not only create backups; you
     111          should also verify that the restore process
     112          really works. The time to test the restore procedure
     113          is <emphasis>before</emphasis> you urgently need
     114          to recover lost data.
    117115        </para>
    118116      </note>
    119117
    120118      <para>
    121         In general, most (all?) database server software provides some basic
     119        Most database server software provides some basic
    122120        tools to create backups of your data. Usually the backups created with
    123121        those tools can be read by newer versions of the software (via a
    124         restore tool). Using older restore tools with newer backup data is not
    125         defined and you should <emphasis>never</emphasis> blindly assume that
     122        restore tool). Using older restore tools with newer backup data is
     123        a bad idea; you should <emphasis>never</emphasis> blindly assume that
    126124        it will work. It might, but usually it doesn't.
    127125      </para>
     
    135133          <para>Create a full database backup using the old tools.</para>
    136134
    137           <para>This step creates an offline copy of the database files ready
    138           to be used for long term archiving, for disaster recovery, or just
    139           preparation for upgrade. This offline backup consists of the full
    140           one-to-one copy of the current database files or a backup of the
    141           files from a certain time in history plus all journal data (that is
     135          <para>This step creates an offline copy of the database files&mdash;for
     136          long term archiving, for disaster recovery, or as
     137          preparation for an upgrade. This offline backup consists of either (1) a full
     138          one-to-one copy of the current database files, or (2) a full backup of the
     139          database files from a certain point in time, plus all the journal data (that is
    142140          Oracle&reg; terminology, it is called "Continuous Archiving" or
    143           "write ahead log (WAL)" in Postgresql) containing information about
    144           changes made to the data content. The later take less time to create
    145           if the DB software provides this type of journaling as you only have
    146           to save the changes after creating the last backup. The amount of
    147           data to backup is much less than doing a full backup every
    148           time.</para>
    149 
    150           <para>In terms of upgrading database server software, a full backup
     141          "write ahead log (WAL)" in Postgresql) describing the
     142          changes made after that point in time. This second form takes less time to create
     143          (if the DB software provides this type of journaling) because you only have
     144          to save the data that have changed since the last full backup was created.</para>
     145
     146          <para>When upgrading database server software, a full backup
    151147          (which can be used for subsequent incremental backups) should be
    152           made, but if the amount of data is too big, an incremental backup will
    153           be sufficient. Which strategy is appropriate for you depends on
     148          created; but if there is a lot of data, an incremental backup will
     149          suffice. The best strategy for you depends on
    154150          the amount of data stored in your database (is it a few hundred table
    155           rows or is it hundreds of terabytes?). A full backup of the later one
    156           isn't done quickly (and we assume that the underlying system of such
    157           a database is probably not on an LFS system).  To close the last gap
    158           to fully protect your data, create a backup of the corresponding old
    159           binaries (and/or their sources) and store it along with the data
    160           files to make sure that there is a fallback solution if
    161           the newer software is not able to read the older data.</para>
     151          rows, or is it hundreds of terabytes?). A full backup in the latter case
     152          can't be done quickly.  To
     153          fully protect your data, create a backup of the old
     154          programs (and/or their sources) and save it, along with the data
     155          files, to be certain there is a fallback solution if
     156          the new software cannot read the old data.</para>
    162157          </listitem>
    163158
     
    177172            software should be used. During the restoration process, the new
    178173            tools will create and/or upgrade the data files in the format the
    179             software requires. It is assumed that newer software is capable of
     174            new software requires. It is assumed that newer software is capable of
    180175            reading old data.</para>
    181176          </listitem>
     
    183178
    184179      <para>
    185         Since you have already have a backup procedure in place (and you
     180        Since you already have a backup procedure in place (and you
    186181        have tested your restore procedure, right?), this might
    187         be the easiest way to upgrade as you are going to use your well known
     182        be the easiest way to upgrade as you can use your well known
    188183        processes to upgrade just as you always do&mdash;at least in terms
    189184        of the backup and restore.
     
    193188
    194189    <sect3>
    195       <title>Upgrade the database files by using system tools</title>
     190      <title>Upgrade the Database Files by Using System Tools</title>
    196191
    197192      <para>
    198193        Some database systems (for instance Postgresql) provide
    199194        a tool which can reformat (upgrade) the existing database
    200         files to the new format. Since the upgrading tool has to
    201         be used from the new server software (the old one cannot
    202         know anything about a new file format), the old software
    203         might be overwritten due to installation of the new software.
    204       </para>
    205 
    206       <para>
    207         In case you have to restore a backup (for example, running
    208         the upgrade tool failed) you have to reinstall the old version
    209         to get back the access to your data.
    210       </para>
    211 
    212       <para>
    213         Even though those tools might work with one of the actual database
    214         files, you should create a full backup before running them. A failure
    215         might result in a serious damage of the database files.
     195        files to the new format.
     196        If you need to restore from a backup (for example, running
     197        the upgrade tool failed) you will have to reinstall the old software
     198        to recover your data.
     199      </para>
     200
     201      <para>
     202        Even though the reformatting tools might work as advertised,
     203        you should create a full backup before running them. A failure
     204        could cause serious damage to the database.
    216205      </para>
    217206
     
    221210
    222211  <sect2>
    223     <title>Notes for specific DBMS</title>
     212    <title>Notes for Specific DBMS</title>
    224213
    225214    <sect3>
     
    251240
    252241      <para>Do not underestimate <application>Sqlite</application>. It is a
    253       feature rich DBMS. The main difference from the two big players above is
     242      feature-rich DBMS. The main difference from the two big players above is
    254243      that Sqlite does not provide access via a network API. Sqlite databases
    255       are files always stored on the same machine as the running program which
     244      are always stored on the machine running the program which
    256245      uses the database. The manipulation of data content is done via API calls
    257246      to library functions directly within the program.</para>
     
    269258
    270259      <para>Unfortunately, there is no dedicated chapter in the
    271       upstream documentation talking about backup/restore but
     260      upstream documentation talking about backup/restore, but
    272261      there are several articles about it on the
    273       Internet. One example is shown below.</para>
     262      Internet. Here is an example.</para>
    274263
    275264      <para>Documentation for Backup/Restore:
     
    284273      <!-- might add some advanced notes for the DBMS here -->
    285274
    286       <para>Just like <application>Sqlite</application> this
    287       software acts on local database files meaning there is no
     275      <para>Like <application>Sqlite</application>, this
     276      software acts on local database files; there is no
    288277      network interface.</para>
    289278
    290       <para>The relevant resources for Backup/Restore a Berkeley database
     279      <para>The relevant resources to back up/restore a Berkeley database
    291280      are the man pages for <filename>db_dump</filename> and its
    292281      counterpart <filename>db_load</filename>.</para>
Note: See TracChangeset for help on using the changeset viewer.