From 0bfbacfd66f3862ecb331f5492722c09d8cc8df9 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 20 Mar 2014 15:33:41 +0100 Subject: [PATCH] No need to back up the config files, they don't get overwritten if you answer "No" Updated the readme. --- build/NuSpecs/tools/Readme.txt | 7 +++++-- build/NuSpecs/tools/install.ps1 | 26 ++++++-------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/build/NuSpecs/tools/Readme.txt b/build/NuSpecs/tools/Readme.txt index 939ea026b6..86f8a832d7 100644 --- a/build/NuSpecs/tools/Readme.txt +++ b/build/NuSpecs/tools/Readme.txt @@ -1,8 +1,11 @@ A note about running Umbraco from Visual Studio. -When upgrading your website using NuGet, make sure to backup all of your config files and web.config. +When upgrading your website using NuGet you should answer "No" to the questions to overwrite the Web.config +file (and config files in the config folder). +We will overwrite Web.config anyway but we keep a backup in the App_Data\ConfigBackup folder. There you'll +find a folder with the current date and time in which the backup has been placed. Make sure to merge the +new file with the old backup files before you proceed. Only the web.config will be overwritten by default to ensure that it has the necessary settings from the current release. -This means that you'll have to merge the files if you made any changes to the previous config files. The config files found in the config folder will usually not be changed for patch releases, so they can usually be skipped, but the web.config will have to have its previous "umbracoConfigurationStatus"-appsetting and "umbracoDbDSN" connection string diff --git a/build/NuSpecs/tools/install.ps1 b/build/NuSpecs/tools/install.ps1 index f1c405e239..366045ba32 100644 --- a/build/NuSpecs/tools/install.ps1 +++ b/build/NuSpecs/tools/install.ps1 @@ -1,31 +1,17 @@ param($rootPath, $toolsPath, $package, $project) if ($project) { - # Create a backup of extisting umbraco config files - $configPath = Join-Path (Split-Path $project.FullName -Parent) "\config" - - $ticks = (Get-Date).ToFileTime() - $backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\ConfigBackup\$ticks" - $configBackupPath = Join-Path $backupPath "config" - - New-Item -ItemType Directory -Force -Path $configBackupPath - - Get-ChildItem -Path $configPath | - Where -filterscript {($_.Name.EndsWith("config"))} | Foreach-Object { - $newFileName = Join-Path $configBackupPath $_.Name - New-Item -ItemType File -Path $newFileName -Force - Copy-Item $_.FullName $newFileName -Force - } - + $dateTime = Get-Date -Format yyyyMMdd-HHmmss + $backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\ConfigBackup\$dateTime" + + # Create backup folder if it doesn't exist yet + New-Item -ItemType Directory -Force -Path $backupPath + # Create a backup of original web.config $projectDestinationPath = Split-Path $project.FullName -Parent $webConfigSource = Join-Path $projectDestinationPath "Web.config" Copy-Item $webConfigSource $backupPath -Force - # Copy Config files from package to project folder - $configFilesPath = Join-Path $rootPath "Content\Config\*.config" - Copy-Item $umbracoFilesPath $configPath -Force - # Copy Web.config from package to project folder $umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\Web.config" Copy-Item $umbracoFilesPath $projectDestinationPath -Force