Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (38 sloc) 1.469 kB
import logging
from holland.core.command import Command, option
from holland.core.plugin import load_first_entrypoint
from holland.core.spool import spool
LOGGER = logging.getLogger(__name__)
class Restore(Command):
Restore data from an existing Holland backup
The actual restore is delegated to the backup plugin that
created the backup.
holland ${cmd_name} some-backup --help
# Example restore for a mysqldump based backup
holland ${cmd_name} some-backup --table mysql.proc
name = 'restore'
aliases = [
options = [
option('--dry-run', '-n', action='store_true',
help="Print what restore actually would do without actually running the restore")
description = 'Restore data from an existing Holland Backup'
def __init__(self):
def run(self, cmd, opts, backup_name, *restore_options):
backup = spool.find_backup(backup_name)
if not backup:
logging.error("No backup found named %s", backup_name)
return 1
config = backup.config
plugin_name = config.get('holland:backup', {}).get('plugin')
plugin = load_first_entrypoint('holland.restore', plugin_name)(backup)
plugin.dispatch([plugin_name] + list(restore_options))
return 1
Jump to Line
Something went wrong with that request. Please try again.