Skip to content

Restoring a single file — mail, home, or database from JetBackup

How to restore a single file from JetBackup whether it's a message in a mailbox, a file in the home directory, or a row in a database — without restoring the whole account.

A customer needs one email back, or one image, or one database row — and a full account restore would clobber three other changes from the past 24 hours. JetBackup supports file-level restore for all three, but the path differs depending on the target. Knowing which UI to open saves the round-trip.

What’s happening

JetBackup stores backups as structured tarballs and database dumps. A “file restore” can target a specific file inside the home tarball, or a specific message inside the mail tarball, or a specific table or row inside the database dump. The UI offers separate flows: WHM > JetBackup 5 > Restore > Files for home, > Email for mail, > Databases for SQL.

For databases, single-row restore isn’t really a feature — what JetBackup gives you is the ability to import the snapshot’s database as a separate name, then you copy rows manually via SQL.

How to verify

Confirm the snapshot has the target item:

jetbackup5api -F getRestorePoints -D '{"account":"<user>"}'
jetbackup5api -F snapshotContents -D '{"snapshot_id":"<id>","section":"homedir"}'
jetbackup5api -F snapshotContents -D '{"snapshot_id":"<id>","section":"databases"}'

For mail, list the maildir contents inside the snapshot — JetBackup will navigate the tarball without extracting it.

The fix

  1. Home directory file: WHM > JetBackup 5 > Restore > Files. Browse to the file path, select it, restore. JetBackup overwrites in place by default; if you want a side-by-side, restore to a different path and merge.
  2. Mail message: WHM > JetBackup 5 > Restore > Email. Navigate to the mailbox, select the message or folder, restore. For Maildir-style mailboxes, JetBackup respects the cur/new/tmp structure — don’t manually copy mail files, let the restore handle it.
  3. Database table: WHM > JetBackup 5 > Restore > Databases. Restore the whole DB to a temp name like <user>_restored. Then connect with mysql and copy the table: INSERT INTO <live_db>.<table> SELECT * FROM <user>_restored.<table> — adjust for primary key conflicts.
  4. Database single row: there is no single-row UI. Restore to a temp DB as above, find the row, write the UPDATE or INSERT manually. Document the SQL in the ticket.
  5. After any restore, verify the change took. For a file, cat it. For mail, log into webmail and confirm the message appears. For a database row, query it.

Stack Harbor handles single-item restores for managed cPanel customers under environment management.