<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="replication-solutions-backups">
      </a>
      19.4.1 Using Replication for Backups
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="replication-solutions-backups-mysqldump.html">
       19.4.1.1 Backing Up a Replica Using mysqldump
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-solutions-backups-rawdata.html">
       19.4.1.2 Backing Up Raw Data from a Replica
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="replication-solutions-backups-read-only.html">
       19.4.1.3 Backing Up a Source or Replica by Making It Read Only
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <p>
   To use replication as a backup solution, replicate data from the
      source to a replica, and then back up the replica. The replica can
      be paused and shut down without affecting the running operation of
      the source, so you can produce an effective snapshot of
   <span class="quote">
    “
    <span class="quote">
     live
    </span>
    ”
   </span>
   data that would otherwise require the source
      to be shut down.
  </p>
  <p>
   How you back up a database depends on its size and whether you are
      backing up only the data, or the data and the replica state so
      that you can rebuild the replica in the event of failure. There
      are therefore two choices:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      If you are using replication as a solution to enable you to
          back up the data on the source, and the size of your database
          is not too large, the
      <a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
       <span class="command">
        <strong>
         mysqldump
        </strong>
       </span>
      </a>
      tool may be
          suitable. See
      <a class="xref" href="replication-solutions-backups-mysqldump.html" title="19.4.1.1 Backing Up a Replica Using mysqldump">
       Section 19.4.1.1, “Backing Up a Replica Using mysqldump”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      For larger databases, where
      <a class="link" href="mysqldump.html" title="6.5.4 mysqldump — A Database Backup Program">
       <span class="command">
        <strong>
         mysqldump
        </strong>
       </span>
      </a>
      would
          be impractical or inefficient, you can back up the raw data
          files instead. Using the raw data files option also means that
          you can back up the binary and relay logs that make it
          possible to re-create the replica in the event of a replica
          failure. For more information, see
      <a class="xref" href="replication-solutions-backups-rawdata.html" title="19.4.1.2 Backing Up Raw Data from a Replica">
       Section 19.4.1.2, “Backing Up Raw Data from a Replica”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   Another backup strategy, which can be used for either source or
      replica servers, is to put the server in a read-only state. The
      backup is performed against the read-only server, which then is
      changed back to its usual read/write operational status. See
   <a class="xref" href="replication-solutions-backups-read-only.html" title="19.4.1.3 Backing Up a Source or Replica by Making It Read Only">
    Section 19.4.1.3, “Backing Up a Source or Replica by Making It Read Only”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
