LogoLogo
DoltHubBlogDiscordGitHubDolt
  • Introduction
    • What Is Dolt?
    • Installation
      • Linux
      • Windows
      • Mac
      • Build from Source
      • Application Server
      • Docker
      • Upgrading
    • Getting Started
      • Version Controlled Database
      • Git For Data
      • Versioned MySQL Replica
    • Use Cases
      • Data Sharing
      • Data and Model Quality Control
      • Manual Data Curation
      • Version Control for your Application
      • Versioned MySQL Replica
      • Audit
      • Configuration Management
      • Offline First
  • Concepts
    • Dolt
      • Git
        • Commits
        • Log
        • Diff
        • Branch
        • Merge
        • Conflicts
        • Remotes
        • Working Set
      • SQL
        • Databases
        • Schema
        • Tables
        • Primary Keys
        • Types
        • Indexes
        • Views
        • Constraints
        • Triggers
        • Procedures
        • Users/Grants
        • Transactions
        • System Variables
      • RDBMS
        • Server
        • Backups
        • Replication
    • DoltHub/DoltLab
      • Permissions
      • Pull Requests
      • Issues
      • Forks
  • SQL Reference
    • Running the Server
      • Configuration
      • Access Management
      • Branch Permissions
      • Backups
      • Garbage Collection
      • Metrics
      • Replication
      • Troubleshooting
    • Version Control Features
      • Using Branches
      • Merges
      • Querying History
      • Using Remotes
      • Procedures
      • Functions
      • System Tables
      • System Variables
      • Saved Queries
    • SQL Language Support
      • Data Description
      • Expressions, Functions, Operators
      • Supported Statements
      • MySQL Information Schema
      • Collations and Character Sets
      • System Variables
      • Miscellaneous
    • Supported Clients
      • Programmatic
      • SQL Editors
    • Benchmarks and Metrics
      • Correctness
      • Latency
      • Import
  • CLI Reference
    • Commands
    • Git Comparison
  • Architecture
    • Overview
    • Storage Engine
      • Commit Graph
      • Prolly Trees
      • Block Store
    • SQL
      • Go MySQL Server
      • Vitess
  • Guides
    • Cheat Sheet
    • Contributing
      • dolt
      • go-mysql-server
    • MySQL to Dolt Replication
    • Importing Data
    • Integrations
  • Other
    • FAQ
    • Roadmap
    • Versioning
  • Products
    • Hosted Dolt
      • Getting Started
      • Notable Features
      • SQL Workbench
      • Cloning a Hosted Database
      • Using DoltHub as a Remote
      • Infrastructure
    • DoltHub
      • Data Sharing
      • API
        • Authentication
        • SQL
        • CSV
        • Database
        • Hooks
      • Continuous Integration
        • Getting Started
        • Workflow Reference
      • Transform File Uploads
      • Workspaces
    • DoltLab
    • Dolt Workbench
    • DoltgreSQL
Powered by GitBook
On this page
  • What is a Backup?
  • How to use Backups
  • Difference between MySQL Backups and Dolt Backups
  • Interaction with Dolt Version Control
  • Example
  • Create a new backup
  • Updating a backup
  • Restoring from a backup

Was this helpful?

Edit on GitHub
Export as PDF
  1. Concepts
  2. Dolt
  3. RDBMS

Backups

PreviousServerNextReplication

Last updated 1 year ago

Was this helpful?

What is a Backup?

A backup is a copy of your database. You can restore the state of the database as it existed at the time of the backup.

How to use Backups

Backups are used for disaster recovery. When you create a backup it is wise to copy the backup to a different host. If you lose access to the host that houses your database, you restore the database from a backup on another host.

Backups have additional uses. Taking a backup of a database is often the easiest way to get a copy of the database. You can use this copy for development, testing, or analytics.

Difference between MySQL Backups and Dolt Backups

Dolt does not support any of the except the mysqldump method. Dolt can create a dump using the or mysqldump connected to the running Dolt server.

Interaction with Dolt Version Control

Dolt supports different methods of backup that leverage Dolt's git-style features.

Dolt databases contain the entire history of the database, meaning Dolt has backups built in to the running server. To restore to a previous point on a running server, you checkout the database at the commit you would like to restore to.

To replicate your database off host so you can restore if you lose the host, Dolt supports two different concepts: remotes and backups.

Using a for backup allows you to back up all committed changes. You add a remote using the . Then you push a branch to a remote using the or .

Dolt has an additional backup functionality beyond remotes. Using dolt backup backs up uncommitted changes as well. Backups are accessed via the or .

Interestingly, you can trigger backups from your application using the dolt_backup() procedure. If you hit a weird edge case you can create a backup of the state of your database for debugging.

Example

Create a new backup

%% dolt backup add backup1 file://../backups/backup1
/ Tree Level: 1, Percent Buffered: 0.00% Files Written: 0, Files Uploaded: 1

Updating a backup

$ dolt backup sync backup1

Restoring from a backup

$ dolt backup restore file://./backups/backup1 repo2
$ dolt branch -a
* main
$ dolt status
MySQL backup methods
remote
dolt_push() procedure
dolt_backup() procedure
dolt dump command
dolt remote command
dolt push command
dolt backup command