No need to back up the config files, they don't get overwritten if you answer "No"
Updated the readme.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user