Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-11-07 03:49:25 +0400
committerTom Needham <needham.thomas@gmail.com>2012-11-09 01:35:20 +0400
commit3a5298287bc1730ce5bfca2f2b359c9285afd028 (patch)
tree21391cb9c4635c9ae8ef7e1446a4fc0ed1156fd0 /lib
parent3cd31eee6ea61fec5a2310d1718b73fe5939fffc (diff)
Migration: Allow for no app data cases; handle file copying better
Diffstat (limited to 'lib')
-rw-r--r--lib/migrate.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/migrate.php b/lib/migrate.php
index 18a442aae95..870e16e1261 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -235,12 +235,19 @@ class OC_Migrate{
return json_encode( array( 'success' => false ) );
}
// Copy data
- if( !self::copy_r( $extractpath . $json->exporteduser, $datadir . '/' . self::$uid ) ){
- return json_encode( array( 'success' => false ) );
+ $userfolder = $extractpath . $json->exporteduser;
+ $newuserfolder = $datadir . '/' . self::$uid;
+ foreach(scandir($userfolder) as $file){
+ if($file !== '.' && $file !== '..' && is_dir($file)){
+ // Then copy the folder over
+ 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 ) ){