1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Database upgrade</title> 7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" /> 10 <link rel="up" href="am.html" title="Chapter 3. Access Method Operations" /> 11 <link rel="prev" href="am_truncate.html" title="Database truncation" /> 12 <link rel="next" href="am_verify.html" title="Database verification and salvage" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Database upgrade</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="am_truncate.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 3. 23 Access Method Operations 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="am_verify.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="am_upgrade"></a>Database upgrade</h2> 35 </div> 36 </div> 37 </div> 38 <p>When upgrading to a new release of Berkeley DB, it may be necessary to upgrade 39the on-disk format of already-created database files. <span class="bold"><strong>Berkeley DB 40database upgrades are done in place, and so are potentially 41destructive.</strong></span> This means that if the system crashes during the upgrade 42procedure, or if the upgrade procedure runs out of disk space, the 43databases may be left in an inconsistent and unrecoverable state. To 44guard against failure, the procedures outlined in 45<a class="xref" href="upgrade_process.html" title="Upgrading Berkeley DB installations">Upgrading Berkeley DB installations</a> 46should be carefully followed. If you are not performing catastrophic 47archival as part of your application upgrade process, you should at 48least copy your database to archival media, verify that your archival 49media is error-free and readable, and that copies of your backups are 50stored offsite!</p> 51 <p>The actual database upgrade is done using the <a href="../api_reference/C/dbupgrade.html" class="olink">DB->upgrade()</a> 52method, or by dumping the database using the old version of the Berkeley DB 53software and reloading it using the current version.</p> 54 <p>After an upgrade, Berkeley DB applications must be recompiled to use the new 55Berkeley DB library before they can access an upgraded database. 56<span class="bold"><strong>There is no guarantee that applications compiled against 57previous releases of Berkeley DB will work correctly with an upgraded database 58format. Nor is there any guarantee that applications compiled against 59newer releases of Berkeley DB will work correctly with the previous database 60format.</strong></span> We do guarantee that any archived database may be upgraded 61using a current Berkeley DB software release and the <a href="../api_reference/C/dbupgrade.html" class="olink">DB->upgrade()</a> 62method, and there is no need to step-wise upgrade the database using 63intermediate releases of Berkeley DB. Sites should consider archiving 64appropriate copies of their application or application sources if they 65may need to access archived databases without first upgrading them.</p> 66 </div> 67 <div class="navfooter"> 68 <hr /> 69 <table width="100%" summary="Navigation footer"> 70 <tr> 71 <td width="40%" align="left"><a accesskey="p" href="am_truncate.html">Prev</a> </td> 72 <td width="20%" align="center"> 73 <a accesskey="u" href="am.html">Up</a> 74 </td> 75 <td width="40%" align="right"> <a accesskey="n" href="am_verify.html">Next</a></td> 76 </tr> 77 <tr> 78 <td width="40%" align="left" valign="top">Database truncation </td> 79 <td width="20%" align="center"> 80 <a accesskey="h" href="index.html">Home</a> 81 </td> 82 <td width="40%" align="right" valign="top"> Database verification and salvage</td> 83 </tr> 84 </table> 85 </div> 86 </body> 87</html> 88