From 49c5d0159a0b8c6ce8f4ddb3a793f4debee99d6d Mon Sep 17 00:00:00 2001 From: Mischa Gorinskat Date: Fri, 22 May 2015 11:47:48 +0200 Subject: [PATCH] CS-5790: Fixes issue when images/files/videos/pdf folder is symlink --- newscoop/bin/newscoop-restore | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/newscoop/bin/newscoop-restore b/newscoop/bin/newscoop-restore index 798ec36770..a40078c884 100755 --- a/newscoop/bin/newscoop-restore +++ b/newscoop/bin/newscoop-restore @@ -371,10 +371,10 @@ if ($backupVersion < 3) { $configSrcDir = "$tempDirName/conf/database_conf.php"; } -$fileSrcDir = "$tempDirName/files"; -$imagesSrcDir = "$tempDirName/images"; -$videosSrcDir = "$tempDirName/videos"; -$pdfSrcDir = "$tempDirName/pdf"; +$fileSrcDir = "$tempDirName/files/."; +$imagesSrcDir = "$tempDirName/images/."; +$videosSrcDir = "$tempDirName/videos/."; +$pdfSrcDir = "$tempDirName/pdf/."; $configDestDir = $ETC_DIR; $filesDestDir = $CAMPSITE_DIR.'/public/files'; $imagesDestDir = $CAMPSITE_DIR.'/images'; @@ -492,21 +492,21 @@ echo "done.\n"; echo " * Restoring images..."; flush_output($flush); if (is_dir($imagesSrcDir)) { - camp_copy_files($imagesSrcDir, $CAMPSITE_DIR); + camp_copy_files($imagesSrcDir, $imagesDestDir); } echo "done.\n"; echo " * Restoring videos..."; flush_output($flush); if (is_dir($videosSrcDir)) { - camp_copy_files($videosSrcDir, $destination); + camp_copy_files($videosSrcDir, $videosDestDir); } echo "done.\n"; echo " * Restoring file attachments..."; flush_output($flush); if (is_dir($fileSrcDir)) { - camp_copy_files($fileSrcDir, $destination); + camp_copy_files($fileSrcDir, $filesDestDir); } echo "done.\n"; //flush_output($flush); @@ -514,7 +514,7 @@ echo "done.\n"; echo " * Restoring PDFs..."; flush_output($flush); if (is_dir($pdfSrcDir)) { - camp_copy_files($pdfSrcDir, $destination); + camp_copy_files($pdfSrcDir, $pdfDir); } echo "done.\n"; @@ -612,7 +612,7 @@ echo "done.\n"; if ($convertToUTF) { echo " * Converting the database from '$fromCharset' to 'UTF-8'...\n"; - + $dumpFile = "$tempDirName/$destDbName-database-$fromCharset.sql"; if (camp_backup_database($destDbName, $dumpFile, $output, array("--default-character-set=$fromCharset")) != 0) { @@ -624,7 +624,7 @@ echo "done.\n"; camp_restore_database($outDumpFile); unlink($dumpFile); unlink($outDumpFile); - + echo " done.\n"; } //}