Changeset fe9a4337
- Timestamp:
- 10/22/2022 06:37:31 PM (2 years ago)
- Branches:
- 11.3, 12.0, 12.1, 12.2, gimp3, 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/for-12.3, xry111/llvm18, xry111/spidermonkey128, xry111/xf86-video-removal
- Children:
- 69d5316
- Parents:
- 736a977
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/databases/upgradedb.xml
r736a977 rfe9a4337 13 13 </sect1info> 14 14 15 <title>Important notes about upgrading Database Server Software</title>15 <title>Important Notes About Upgrading Database Server Software</title> 16 16 17 17 <note><para>This section is about reinstalling database software … … 21 21 to become aware of issues that can arise in the future.</para></note> 22 22 23 <para>Let s start this chapter with a dramatic screenshot of an issuethat24 really happened. This issue will not occur if you are going to install the25 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> 26 26 27 27 <screen>$ sudo systemctl status postgresql … … 45 45 46 46 <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). 51 50 </para> 52 51 53 52 <para> 54 The root cause of the issueshown above was an upgrade55 of the server software to a newer major version but leavingthe56 data files untouched. The administrator was able to recover without any57 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. 58 57 </para> 59 58 60 59 <para> 61 Even if you are doing an in stall DBMS install, read through this62 section. Tt will provide you information about how to set upbackup63 and restore procedures ( at least the strategy for building64 them) which are sufficient for your needs and forthe safety60 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 65 64 of your data. 66 65 </para> 67 66 68 67 <sect2> 69 <title>Upgrade database server packages</title>68 <title>Upgrade Database Server Packages</title> 70 69 71 70 <para> 72 71 Database systems work on files which hold the database metadata and the 73 data itself. Th ose files are highly optimized in their internal74 structures for use by the server software. When upgrading such server75 software, newer server software may expecta different file format than76 was created by previous versions. In the best case,the new software can77 act on the old format as well—but not benefitting from newer78 formats which might result in better performance or of other79 improvements. It can also happen thatthe new server software will80 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—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. 81 80 </para> 82 81 83 82 <para> 84 83 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 be87 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 but92 potentially can come at other times. Before upgrading the server93 software, check the documentation if there are changes which will84 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 94 93 require reformatting the database. 95 94 </para> 96 95 97 96 <para> 98 Of course, if you have databases with content which is not easy to99 rebuil d, it is always a good idea to create backups of the database from100 time to time. When upgrading the server software, it is time torun97 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 101 100 another backup. 102 101 </para> 103 102 104 103 <sect3> 105 <title>Upgrade by backup and restore</title>104 <title>Upgrade by Backup and Restore</title> 106 105 107 106 <note> 108 107 <para> 109 A backup is meaningless if there is no verified process108 A backup is useless if there is no verified process 110 109 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—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. 117 115 </para> 118 116 </note> 119 117 120 118 <para> 121 In general, most (all?)database server software provides some basic119 Most database server software provides some basic 122 120 tools to create backups of your data. Usually the backups created with 123 121 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 not125 defined andyou should <emphasis>never</emphasis> blindly assume that122 restore tool). Using older restore tools with newer backup data is 123 a bad idea; you should <emphasis>never</emphasis> blindly assume that 126 124 it will work. It might, but usually it doesn't. 127 125 </para> … … 135 133 <para>Create a full database backup using the old tools.</para> 136 134 137 <para>This step creates an offline copy of the database files ready138 to be used for long term archiving, for disaster recovery, or just139 preparation for upgrade. This offline backup consists of thefull140 one-to-one copy of the current database files or abackup of the141 files from a certain time in history plus alljournal data (that is135 <para>This step creates an offline copy of the database files—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 142 140 Oracle® 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 151 147 (which can be used for subsequent incremental backups) should be 152 made, but if the amount of data is too big, an incremental backup will153 be sufficient. Which strategy is appropriatefor you depends on148 created; but if there is a lot of data, an incremental backup will 149 suffice. The best strategy for you depends on 154 150 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> 162 157 </listitem> 163 158 … … 177 172 software should be used. During the restoration process, the new 178 173 tools will create and/or upgrade the data files in the format the 179 software requires. It is assumed that newer software is capable of174 new software requires. It is assumed that newer software is capable of 180 175 reading old data.</para> 181 176 </listitem> … … 183 178 184 179 <para> 185 Since you havealready have a backup procedure in place (and you180 Since you already have a backup procedure in place (and you 186 181 have tested your restore procedure, right?), this might 187 be the easiest way to upgrade as you are going touse your well known182 be the easiest way to upgrade as you can use your well known 188 183 processes to upgrade just as you always do—at least in terms 189 184 of the backup and restore. … … 193 188 194 189 <sect3> 195 <title>Upgrade the database files by using system tools</title>190 <title>Upgrade the Database Files by Using System Tools</title> 196 191 197 192 <para> 198 193 Some database systems (for instance Postgresql) provide 199 194 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. 216 205 </para> 217 206 … … 221 210 222 211 <sect2> 223 <title>Notes for specific DBMS</title>212 <title>Notes for Specific DBMS</title> 224 213 225 214 <sect3> … … 251 240 252 241 <para>Do not underestimate <application>Sqlite</application>. It is a 253 feature 242 feature-rich DBMS. The main difference from the two big players above is 254 243 that Sqlite does not provide access via a network API. Sqlite databases 255 are files always stored on the same machine as the runningprogram which244 are always stored on the machine running the program which 256 245 uses the database. The manipulation of data content is done via API calls 257 246 to library functions directly within the program.</para> … … 269 258 270 259 <para>Unfortunately, there is no dedicated chapter in the 271 upstream documentation talking about backup/restore but260 upstream documentation talking about backup/restore, but 272 261 there are several articles about it on the 273 Internet. One example is shown below.</para>262 Internet. Here is an example.</para> 274 263 275 264 <para>Documentation for Backup/Restore: … … 284 273 <!-- might add some advanced notes for the DBMS here --> 285 274 286 <para> Just like <application>Sqlite</application>this287 software acts on local database files meaningthere is no275 <para>Like <application>Sqlite</application>, this 276 software acts on local database files; there is no 288 277 network interface.</para> 289 278 290 <para>The relevant resources for Backup/Restore a Berkeley database279 <para>The relevant resources to back up/restore a Berkeley database 291 280 are the man pages for <filename>db_dump</filename> and its 292 281 counterpart <filename>db_load</filename>.</para>
Note:
See TracChangeset
for help on using the changeset viewer.