From 56dadb688a4aba474bab344ec0b4bdb0aeccadba Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Tue, 23 Nov 2021 00:41:11 +0000 Subject: [PATCH 1/4] Fix backup version mix-up --- powershell/Update-Alteryx.ps1 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/powershell/Update-Alteryx.ps1 b/powershell/Update-Alteryx.ps1 index a1e53c8..61b399f 100644 --- a/powershell/Update-Alteryx.ps1 +++ b/powershell/Update-Alteryx.ps1 @@ -10,7 +10,7 @@ function Update-Alteryx { File name: Update-Alteryx.ps1 Author: Florian Carrier Creation date: 2021-09-02 - Last modified: 2021-11-20 + Last modified: 2021-11-22 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -45,29 +45,31 @@ function Update-Alteryx { $AlteryxService = Get-AlteryxUtility -Utility "Service" -Path $Properties.InstallationPath # Clear error pipeline $Error.Clear() - } - Process { - Write-Log -Type "CHECK" -Object "Starting Alteryx Server upgrade to $($Properties.Version)" # Retrieve current version - Write-Log -Type "INFO" -Object "Retrieving current version" + Write-Log -Type "DEBUG" -Object "Retrieving current version" if ($PSCmdlet.ShouldProcess("Alteryx version", "Retrieve")) { - $BackupVersion = Get-AlteryxVersion -Path $AlteryxService + $AlteryxVersion = Get-AlteryxVersion -Path $AlteryxService + Write-Log -Type "DEBUG" -Object $AlteryxVersion + $BackupVersion = Select-String -InputObject $AlteryxVersion -Pattern "\d+\.\d+.\d+(.\d+)?" | ForEach-Object { $PSItem.Matches.Value } } - Write-Log -Type "DEBUG" -Object $BackupVersion + } + Process { + Write-Log -Type "CHECK" -Object "Starting Alteryx Server upgrade from $BackupVersion to $($Properties.Version)" # Create back-up - Invoke-BackupAlteryx -Properties $Properties -Unattended:$Unattended + $BackUpProperties = Copy-OrderedHashtable -Hashtable $Properties + $BackUpProperties.Version = $BackupVersion + Invoke-BackupAlteryx -Properties $BackUpProperties -Unattended:$Unattended # Upgrade Install-Alteryx -Properties $Properties -InstallationProperties $InstallationProperties -Unattended:$Unattended # Check for errors if ($Error.Count -gt 0) { + # Rollback Write-Log -Type "ERROR" -Object "Upgrade process failed with $($Error.Count) errors" Write-Log -Type "WARN" -Object "Restoring previous version ($BackupVersion)" - # Overwrite target version - $Properties.Version = $BackupVersion # Reinstall Alteryx - Install-Alteryx -Properties $Properties -Unattended:$Unattended + Install-Alteryx -Properties $BackUpProperties -Unattended:$Unattended # Restore backup - Invoke-RestoreAlteryx -Properties $Properties -Unattended:$Unattended + Invoke-RestoreAlteryx -Properties $BackUpProperties -Unattended:$Unattended } else { Write-Log -Type "CHECK" -Object "Alteryx Server upgrade completed successfully" } From 05d1a446a87ba3af73bc5e78bce5f27880c42121 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Tue, 23 Nov 2021 00:41:37 +0000 Subject: [PATCH 2/4] Add version to backup file --- powershell/Invoke-BackupAlteryx.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powershell/Invoke-BackupAlteryx.ps1 b/powershell/Invoke-BackupAlteryx.ps1 index ff77cd8..c98bc47 100644 --- a/powershell/Invoke-BackupAlteryx.ps1 +++ b/powershell/Invoke-BackupAlteryx.ps1 @@ -10,7 +10,7 @@ function Invoke-BackupAlteryx { File name: Invoke-BackupAlteryx.ps1 Author: Florian Carrier Creation date: 2021-08-26 - Last modified: 2021-11-21 + Last modified: 2021-11-22 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -35,8 +35,8 @@ function Invoke-BackupAlteryx { Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState # Variables $ISOTimeStamp = Get-Date -Format "yyyyMMdd_HHmmss" - $BackupPath = Join-Path -Path $Properties.BackupDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server.zip" - $TempBackupPath = Join-Path -Path $Properties.TempDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server" + $BackupPath = Join-Path -Path $Properties.BackupDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server_$($Properties.Version).zip" + $TempBackupPath = Join-Path -Path $Properties.TempDirectory -ChildPath "${ISOTimeStamp}_Alteryx_Server_$($Properties.Version)" $MongoDBPath = Join-Path -Path $TempBackupPath -ChildPath "MongoDB" $ServicePath = Join-Path -Path $Properties.InstallationPath -ChildPath "bin\AlteryxService.exe" # Backup options From 8b89169815816c9b8025bc254b8248021cc4a14c Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Tue, 23 Nov 2021 16:52:07 +0000 Subject: [PATCH 3/4] Update default sources location --- README.md | 10 ++++++---- conf/default.ini | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 94cb4f0..eb0b141 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Example script structure with embedded dependencies: ### Alteryx -Alteryx installation files must be made available in the source directory (default `D:\Sources`). See the [compatibility section](#compatibility) for more information about the supported versions. +Alteryx installation files must be made available in the source directory (default `C:\Sources`). See the [compatibility section](#compatibility) for more information about the supported versions. You can download them from . @@ -344,12 +344,12 @@ Below are the steps to restart the Alteryx application. Transcript log files are generated in the log directory of the script. -- The naming convention is as follows: `_-Alteryx.log` +- The naming convention of the transcript log file is: `_-Alteryx.log` - The format of the log is: `\t\t` -Additional log files are generated during the installation, upgrade, or uninstallation of Alteryx as an XML file in teh same log directory. +Additional log files are generated by [InstallAware](https://www.installaware.com/) during the installation, upgrade, or uninstallation of Alteryx as an XML file in the same log directory. Those are disabled by default because of the negative impact on the speed of execution, but they can be enabled by setting the configuration variable `InstallAwareLog` to `true`. -- The naming convention is as follows: `_.log` +The naming convention of the InstallAware log file is: `_.log` Below is an example of a successful installation log: @@ -385,6 +385,7 @@ Only the first version supported is listed. Later releases should also be compat | ---------------- | -------- | ---------- | ------ | ------- | | [1.0.0] | [2021.3] | 5.0 | 1.2.4 | 1.0.0 | | [1.1.0] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | +| [1.1.1] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | ## Known issues @@ -405,4 +406,5 @@ It can be prevented by configuring a temporary directory (`TempDirectory`) that [PSAYX]: https://www.powershellgallery.com/packages/PSAYX [1.0.0]:https://github.com/Akaizoku/alteryx-deploy/releases/1.0.0 [1.1.0]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.0 +[1.1.1]:https://github.com/Akaizoku/alteryx-deploy/releases/1.1.1 [2021.3]:https://help.alteryx.com/release-notes/server/server-20213-release-notes diff --git a/conf/default.ini b/conf/default.ini index 4d0e2f0..7eff010 100644 --- a/conf/default.ini +++ b/conf/default.ini @@ -15,7 +15,7 @@ TempDirectory = \tmp # Resources directory ResDirectory = \res # Sources directory -SrcDirectory = C:\Program Files\Alteryx\Sources +SrcDirectory = C:\Sources # Alteryx installation directory InstallationPath = C:\Program Files\Alteryx # Backup directory From 1e26b6aa96b43e7522f539e994ed812172d3d25f Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Tue, 23 Nov 2021 16:52:42 +0000 Subject: [PATCH 4/4] Update CHANGELOG --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee6b638..2c6fb16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to the [Alteryx deploy](https://github.com/Akaizoku/alteryx- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1](https://github.com/Akaizoku/alteryx-deploy/releases/1.1.1) - 2021-11-23 + +### Changed + +- Updated default sources location + +### Fixed + +- Fixed an issue with upgrade from 2021.3 (or lower) to 2021.4 ([#2](https://github.com/Akaizoku/alteryx-deploy/issues/2)) + ## [1.1.0](https://github.com/Akaizoku/alteryx-deploy/releases/1.1.0) - 2021-11-21 ### Added