570 'Continue anyway?' % filename): |
570 'Continue anyway?' % filename): |
571 raise ExecutionError('Error while deleting remote dump at /tmp/%s' % filename) |
571 raise ExecutionError('Error while deleting remote dump at /tmp/%s' % filename) |
572 |
572 |
573 def _local_dump(appid, output): |
573 def _local_dump(appid, output): |
574 config = ServerConfiguration.config_for(appid) |
574 config = ServerConfiguration.config_for(appid) |
575 # schema=1 to avoid unnecessary schema loading |
575 config.repairing = True # don't check versions |
|
576 #config.read_instance_schema = False # bootstrap schema is enough |
|
577 # schema=1 to avoid unnecessary fs schema loading |
576 mih = config.migration_handler(connect=False, schema=1, verbosity=1) |
578 mih = config.migration_handler(connect=False, schema=1, verbosity=1) |
577 mih.backup_database(output, askconfirm=False) |
579 mih.backup_database(output, askconfirm=False) |
578 mih.shutdown() |
580 mih.shutdown() |
579 |
581 |
580 def _local_restore(appid, backupfile, drop, systemonly=True): |
582 def _local_restore(appid, backupfile, drop, systemonly=True): |
581 config = ServerConfiguration.config_for(appid) |
583 config = ServerConfiguration.config_for(appid) |
582 config.verbosity = 1 # else we won't be asked for confirmation on problems |
584 config.verbosity = 1 # else we won't be asked for confirmation on problems |
583 config.repairing = 1 # don't check versions |
585 config.repairing = True # don't check versions |
584 # schema=1 to avoid unnecessary schema loading |
586 config.read_instance_schema = False # bootstrap schema is enough |
|
587 # schema=1 to avoid unnecessary fs schema loading |
585 mih = config.migration_handler(connect=False, schema=1, verbosity=1) |
588 mih = config.migration_handler(connect=False, schema=1, verbosity=1) |
586 mih.restore_database(backupfile, drop, systemonly, askconfirm=False) |
589 mih.restore_database(backupfile, drop, systemonly, askconfirm=False) |
587 repo = mih.repo_connect() |
590 repo = mih.repo_connect() |
588 # version of the database |
591 # version of the database |
589 dbversions = repo.get_versions() |
592 dbversions = repo.get_versions() |