summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/admin_export/settings.php2
-rw-r--r--lib/db.php9
-rw-r--r--lib/migrate.php10
3 files changed, 10 insertions, 11 deletions
diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php
index 269147a3bc6..719bedb66e8 100644
--- a/apps/admin_export/settings.php
+++ b/apps/admin_export/settings.php
@@ -28,7 +28,7 @@ OC_Util::checkAppEnabled('admin_export');
// Export?
if (isset($_POST['admin_export'])) {
// Create the export zip
- if( !$path = OC_Migrate::export( $_POST['export_type'] ) ){
+ if( !$path = OC_Migrate::export( null, $_POST['export_type'] ) ){
// Error
die('error');
} else {
diff --git a/lib/db.php b/lib/db.php
index a7b7ae75da0..9c46a40addb 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -489,7 +489,7 @@ class OC_DB {
public static function replaceDB( $file ){
$apps = OC_App::getAllApps();
-
+ self::beginTransaction();
// Delete the old tables
self::removeDBStructure( OC::$SERVERROOT . '/db_structure.xml' );
@@ -501,11 +501,8 @@ class OC_DB {
}
// Create new tables
- if( self::createDBFromStructure( $file ) ){
- return true;
- } else {
- return false;
- }
+ self::createDBFromStructure( $file );
+ self::commit();
}
diff --git a/lib/migrate.php b/lib/migrate.php
index db3852fb832..815333b4d89 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -257,28 +257,30 @@ class OC_Migrate{
return $appsimported;
break;
case 'instance':
+ /*
// Check for new data dir and dbexport before doing anything
// TODO
- /*
+
// Delete current data folder.
OC_Log::write( 'migration', "Deleting current data dir", OC_Log::INFO );
- if( self::unlink_r( $datadir, false ) ){
+ if( !self::unlink_r( $datadir, false ) ){
OC_Log::write( 'migration', 'Failed to delete the current data dir', OC_Log::ERROR );
return false;
}
// Copy over data
- if( !self::copy_r( $extractname . 'data', $datadir ) ){
+ if( !self::copy_r( $extractpath . 'userdata', $datadir ) ){
OC_Log::write( 'migration', 'Failed to copy over data directory', OC_Log::ERROR );
return false;
}
- */
+
// Import the db
if( !OC_DB::replaceDB( $extractpath . 'dbexport.xml' ) ){
return false;
}
// Done
return true;
+ */
break;
}