> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_backup

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.create_backup"> <span className="sig-name descname"><span className="pre">create\_backup</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">backup\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">backup\_type</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">backup\_objects\_map</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">datasink\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L21579"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Creates a database <a className="reference external" href="/content/admin/backup_restore/#database-backup">backup</a>, containing a snapshot of existing objects, at the remote file store accessible via the <a className="reference external" href="/content/concepts/data_sinks/">data sink</a> specified by input parameter <span className="em">datasink\_name</span>.</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">backup\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name for this backup. If the backup already exists, only an incremental or differential backup can be made, unless <span className="em">recreate</span> is set to <span className="em">true</span>.</p>
            </div>

            <div className="dt">backup\_type (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Type of snapshot to create. Allowed values are:</p>

              <ul className="simple">
                <li>
                  <p><strong>differential</strong> – Snapshot of changes in the database objects and data since the last full snapshot.</p>
                </li>

                <li>
                  <p><strong>full</strong> – Snapshot of the given database objects and data.</p>
                </li>

                <li>
                  <p><strong>incremental</strong> – Snapshot of changes in the database objects and data since the last snapshot of any kind.</p>
                </li>
              </ul>
            </div>

            <div className="dt">backup\_objects\_map (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Map of objects to be captured in the backup; must be specified when creating a full snapshot and left unspecified when creating an incremental or differential snapshot. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>all</strong> – All object types and data contained in the given <a className="reference external" href="/content/concepts/schemas/">schema(s)</a>.</p>
                </li>

                <li>
                  <p><strong>catalog</strong> – Data Lake catalog that is external to the database.</p>
                </li>

                <li>
                  <p><strong>context</strong> – <a className="reference external" href="/content/sql-gpt/concepts/#sql-gpt-context">Context(s)</a>.</p>
                </li>

                <li>
                  <p><strong>credential</strong> – <a className="reference external" href="/content/concepts/credentials/">Credential(s)</a>.</p>
                </li>

                <li>
                  <p><strong>datasink</strong> – <a className="reference external" href="/content/concepts/data_sinks/">Data sink(s)</a>.</p>
                </li>

                <li>
                  <p><strong>datasource</strong> – <a className="reference external" href="/content/concepts/data_sources/">Data source(s)</a>.</p>
                </li>

                <li>
                  <p><strong>directory</strong> – KiFS <a className="reference external" href="/content/tools/kifs/">File directory(ies)</a>.</p>
                </li>

                <li>
                  <p><strong>function\_environment</strong> – <a className="reference external" href="/content/udf/python/writing/#udf-python-func-env">Python UDF function environment(s)</a>.</p>
                </li>

                <li>
                  <p><strong>graph</strong> – <a className="reference external" href="/content/graph_solver/network_graph_solver/">Graph</a> definition(s). Source table(s), if applicable, are required in order to restore graph objects.</p>
                </li>

                <li>
                  <p><strong>monitor</strong> – <a className="reference external" href="/content/concepts/table_monitors/">Table monitor(s)</a> / <a className="reference external" href="/content/sql/ddl/create-stream">SQL stream(s)</a>.</p>
                </li>

                <li>
                  <p><strong>resource\_group</strong> – <a className="reference external" href="/content/rm/concepts/#resource-groups">Resource group(s)</a>.</p>
                </li>

                <li>
                  <p><strong>role</strong> – <a className="reference external" href="/content/security/sec_concepts/#roles">Role(s)</a>, role members (roles or users, recursively), and associated permissions.</p>
                </li>

                <li>
                  <p><strong>stored\_procedure</strong> – <a className="reference external" href="/content/sql/procedure/">SQL procedure(s)</a>.</p>
                </li>

                <li>
                  <p><strong>table</strong> – <a className="reference external" href="/content/concepts/tables/">Table(s)</a> and <a className="reference external" href="/content/sql/ddl/create-view">SQL view(s)</a>. Active subscriptions on any tables to be backed up will be temporarily suspended while the backup is active.</p>
                </li>

                <li>
                  <p><strong>user</strong> – <a className="reference external" href="/content/security/sec_concepts/#security-concepts-users">User(s)</a> (internal and external) and associated permissions.</p>
                </li>

                <li>
                  <p><strong>user\_defined\_function</strong> – <a className="reference external" href="/content/udf_overview">UDF(s)</a>.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>

            <div className="dt">datasink\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Data sink through which the backup will be stored.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>block\_table\_mutations</strong> – Whether or not to block all mutations on target tables while they are being backed up. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p><strong>true</strong> – Block all mutations on target tables while they are being backed up.</p>
                    </li>

                    <li>
                      <p><strong>false</strong> – Only block mutations on a target table at the point a disk eviction is necessary.</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>checksum</strong> – Whether or not to calculate checksums for backup files. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>comment</strong> – Comments to store with this backup.</p>
                </li>

                <li>
                  <p><strong>ddl\_only</strong> – Whether or not, for tables, to only backup DDL and not table data. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p><strong>true</strong> – For tables, only back up DDL, not data.</p>
                    </li>

                    <li>
                      <p><strong>false</strong> – For tables, back up DDL and data.</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>delete\_intermediate\_backups</strong> – Whether or not to delete any intermediate snapshots when the input parameter <span className="em">backup\_type</span> is set to <span className="em">differential</span>. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>dry\_run</strong> – Whether or not to perform a dry run of a backup operation. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>max\_incremental\_backups\_to\_keep</strong> – Maximum number of incremental snapshots to keep. The default value is ‘-1’.</p>
                </li>

                <li>
                  <p><strong>recreate</strong> – Whether or not to replace an existing backup object with a new backup with a full snapshot, if one already exists. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl simple">
            <div className="dt">backup\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Value of input parameter <span className="em">backup\_name</span>.</p>
            </div>

            <div className="dt">backup\_id (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>ID of the snapshot created.</p>
            </div>

            <div className="dt">copied\_bytes (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total size of all files copied for this snapshot.</p>
            </div>

            <div className="dt">copied\_files (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total number of files copied for this snapshot.</p>
            </div>

            <div className="dt">copied\_records (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total number of records in all files copied for this snapshot.</p>
            </div>

            <div className="dt">total\_number\_of\_records (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>Total number of records that can be restored from this snapshot.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
