Skip to main content
Version: 7.0

Migration from Installer to PowerShell

danger

Attention:

  1. The instructions describe the preparation and migration of Passwork, installed using the Passwork installer or manually, to the PowerShell module.
  2. The instructions are intended for single Passwork installations and are not suitable for failover solutions.

Preparation

Open PowerShell as "Administrator":

Using the Start context menu
  1. Right-click on the Start icon in the lower-left corner of the screen.
  2. Select "Windows PowerShell (Administrator)" from the context menu.
Using the Start menu
  1. Left-click on the Start icon in the lower-left corner of the screen.
  2. Type powershell
  3. Open PowerShell as "Administrator" by pressing Ctrl + Shift + Enter
danger

When using Windows Server 2016, you need to enable the TLS 1.2 security protocol with the following command:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Download the PassworkModule.zip archive to the current directory:

if (-not (Test-Path "$pwd\PassworkModule.zip")) {
(New-Object System.Net.WebClient).DownloadFile(
"https://repos.passwork.pro/repository/powershell/PassworkModule.zip",
"$pwd\PassworkModule.zip"
)
Write-Host "Module successfully downloaded" -ForegroundColor Green
} else {
Write-Host "Module archive already exists" -ForegroundColor Red
}
info

In case of errors, the archive can be downloaded manually: https://repos.passwork.pro/repository/windows_powershell/PassworkModule.zip

Extract the PowerShell module:

# Get the location of PowerShell modules 
$windowsModulePaths = $env:PSModulePath -split ";" | Where-Object { $_ -like "C:\Windows*" }

# Extract the PowerShell module to the directory
Expand-Archive `
-Path "$pwd\PassworkModule.zip" `
-DestinationPath $windowsModulePaths -Force

# Remove the PassworkModule.zip archive
Remove-Item "$pwd\PassworkModule.zip"

Migration

Description

Migration will collect and record information about the used components into a separate file, remove the Passwork installer, and add the ability to use administration functions.

Launching migration process

Start the migration:

Set-Passwork-PowerShell
Actions performed
  1. Processing PassworkSetup.exe
  2. Processing the Passwork website
  3. Retrieving the used Passwork version
  4. Checking the certificate
  5. Processing PHP
  6. Processing MongoDB
  7. Processing Shortcuts in the Start menu and links on the Desktop

The script will create the file C:\inetpub\.passwork_component, which contains details needed for the correct operation of the PowerShell module:

Example of the .passwork_component file
Example of the .passwork_component file after migration
PASSWORK_SETUP = 1
PS_REMOVE = 1
SITE_NAME = Passwork Web Site
PHYSICAL_PATH = C:\inetpub\wwwroot\passwork
PASSWORK_VERSION = 060403
CERT = dwVxgK2WquWvF6pZFV5cuNCE4zlu8GcY5XzRz8ziFaWENbcirdZfSAMlxBvhKXIGmRwNgvq3DIVEf8gr
PHP_VERSION = 8.0.20
DB_VERSION = 4.2.9
DB_CONFIG = C:\Program Files\MongoDB\Server\4.2\bin\mongod.cfg
DB_ROOT = C:\Program Files\MongoDB
MIGRATE = 1