summaryrefslogtreecommitdiffstats
path: root/lib/migrate.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-11-06 23:49:25 +0000
committerTom Needham <needham.thomas@gmail.com>2012-11-08 11:37:27 +0000
commit8396c0478e930d58a45749dbbd96a517279b3b4d (patch)
tree73e220f76125607d96cf2457beed799a8933cc6e /lib/migrate.php
parent0833be9d4eacdfd712b9a52ab4545effb64f790a (diff)
downloadnextcloud-server-8396c0478e930d58a45749dbbd96a517279b3b4d.tar.gz
nextcloud-server-8396c0478e930d58a45749dbbd96a517279b3b4d.zip
Migration: Allow for no app data cases; handle file copying better
Diffstat (limited to 'lib/migrate.php')
-rw-r--r--lib/migrate.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/migrate.php b/lib/migrate.php
index 58b9182a45f..ca74edcdc57 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -238,18 +238,16 @@ class OC_Migrate{
$userfolder = $extractpath . $json->exporteduser;
$newuserfolder = $datadir . '/' . self::$uid;
foreach(scandir($userfolder) as $file){
- $success = true;
if($file !== '.' && $file !== '..' && is_dir($file)){
// Then copy the folder over
- $success = OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
- }
- if(!$success){
- return json_encode( array( 'success' => false ) );
+ OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
}
}
// Import user app data
- if( !$appsimported = self::importAppData( $extractpath . $json->exporteduser . '/migration.db', $json, self::$uid ) ) {
- return json_encode( array( 'success' => false ) );
+ if(file_exists($extractpath . $json->exporteduser . '/migration.db')){
+ if( !$appsimported = self::importAppData( $extractpath . $json->exporteduser . '/migration.db', $json, self::$uid ) ) {
+ return json_encode( array( 'success' => false ) );
+ }
}
// All done!
if( !self::unlink_r( $extractpath ) ) {