<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysqldump-upgrade-testing">
      </a>
      9.4.5.5 Using mysqldump to Test for Upgrade Incompatibilities
     </h4>
    </div>
   </div>
  </div>
  <p>
   When contemplating a MySQL upgrade, it is prudent to install
          the newer version separately from your current production
          version. Then you can dump the database and database object
          definitions from the production server and load them into the
          new server to verify that they are handled properly. (This is
          also useful for testing downgrades.)
  </p>
  <p>
   On the production server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa85696290"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqldump</span> <span class="token property">--all-databases</span> <span class="token property">--no-data</span> <span class="token property">--routines</span> <span class="token property">--events</span> &gt; dump-defs<span class="token punctuation">.</span>sql</code></pre>
  </div>
  <p>
   On the upgraded server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa67355578"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysql</span> &lt; dump-defs<span class="token punctuation">.</span>sql</code></pre>
  </div>
  <p>
   Because the dump file does not contain table data, it can be
          processed quickly. This enables you to spot potential
          incompatibilities without waiting for lengthy data-loading
          operations. Look for warnings or errors while the dump file is
          being processed.
  </p>
  <p>
   After you have verified that the definitions are handled
          properly, dump the data and try to load it into the upgraded
          server.
  </p>
  <p>
   On the production server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa53118777"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysqldump</span> <span class="token property">--all-databases</span> <span class="token property">--no-create-info</span> &gt; dump-data<span class="token punctuation">.</span>sql</code></pre>
  </div>
  <p>
   On the upgraded server:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa86573529"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal"><span class="token prompt">$&gt; </span><span class="token command">mysql</span> &lt; dump-data<span class="token punctuation">.</span>sql</code></pre>
  </div>
  <p>
   Now check the table contents and run some test queries.
  </p>
 </div>
 <br/>
</div>
