[db dump/restore] fix '#615840: db-dump must be always runnable' by setting repairing on config. Also, avoid to read the whole schema from the database on dump/restore: the bootstrap schema is enough. stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Mar 2010 09:18:21 +0100
branchstable
changeset 5033 441191f7def1
parent 5032 e3fa27fc0d9a
child 5034 4781870e97d9
[db dump/restore] fix '#615840: db-dump must be always runnable' by setting repairing on config. Also, avoid to read the whole schema from the database on dump/restore: the bootstrap schema is enough.
server/serverctl.py
--- a/server/serverctl.py	Fri Mar 26 08:32:32 2010 +0100
+++ b/server/serverctl.py	Fri Mar 26 09:18:21 2010 +0100
@@ -572,7 +572,9 @@
 
 def _local_dump(appid, output):
     config = ServerConfiguration.config_for(appid)
-    # schema=1 to avoid unnecessary schema loading
+    config.repairing = True # don't check versions
+    #config.read_instance_schema = False # bootstrap schema is enough
+    # schema=1 to avoid unnecessary fs schema loading
     mih = config.migration_handler(connect=False, schema=1, verbosity=1)
     mih.backup_database(output, askconfirm=False)
     mih.shutdown()
@@ -580,8 +582,9 @@
 def _local_restore(appid, backupfile, drop, systemonly=True):
     config = ServerConfiguration.config_for(appid)
     config.verbosity = 1 # else we won't be asked for confirmation on problems
-    config.repairing = 1 # don't check versions
-    # schema=1 to avoid unnecessary schema loading
+    config.repairing = True # don't check versions
+    config.read_instance_schema = False # bootstrap schema is enough
+    # schema=1 to avoid unnecessary fs schema loading
     mih = config.migration_handler(connect=False, schema=1, verbosity=1)
     mih.restore_database(backupfile, drop, systemonly, askconfirm=False)
     repo = mih.repo_connect()