Administration
...
Updating Passwork components
MongoDB
Windows Server
14min
if a replication suite is used, please contact passwork technical support to update and save data correctly if passwork is installed on a virtual server, we recommend creating a snapshot before updating creating a backup by default mongodb administration utilities are not located in the $path environment variable, to use it you need to search for utilities using powershell run powershell as administrator right click on the start icon in the lower left corner of the screen; select windows powershell (administrator) from the context menu perform a search for administration utilities $utilitypath = get childitem path "c \\" filter "mongodump exe" recurse erroraction silentlycontinue | select object first 1; $utilitydirectory = $utilitypath directoryname; cd $utilitydirectory if mongodb and the administration utilities were installed on a non standard drive, you need to change the search path in the path parameter the current working directory will be changed to the one in which the utilities are located to test it, execute dir create directory powershell mkdir c \backup\\ create a backup powershell $timestamp = get date format "yyyy mm dd hh mm" \mongodump out "c \backup\mongo $timestamp" the mongodump and mongorestore utilities are located in the same mongodb 4 x installation directory removing the older version stop the service powershell net stop mongodb delete the database powershell sc exe delete "mongodb" delete the directory with the contents of the database powershell if (test path "$env\ programfiles\mongodb") { remove item path "$env\ programfiles\mongodb" recurse force write host "mongodb directory has been deleted " foregroundcolor green } else { write host "mongodb directory not found " } perform a search for mongodb in the registry powershell $mongo = get childitem path "hklm \software\microsoft\windows\currentversion\uninstall" | where object { ($ | get itemproperty) displayname like " mongodb " } delete an entry from the registry powershell if ($mongo) { $mongo pspath | remove item recurse force write host "record removed from the registry" foregroundcolor green } else { write host "record with displayname not found" } installing mongodb download mongodb installer powershell try { (new object system net webclient) downloadfile("https //repos passwork pro/repository/windows packages/mongodb database latest msi", "$env\ systemdrive\windows\temp\mongodb database latest msi") write host "mongodb successfully uploaded" foregroundcolor green } catch { write host "error loading mongodb $ " foregroundcolor red } in case of an error, you can download the installer manually install mongodb by default powershell try { start process filepath "msiexec exe" argumentlist "/l v", "$env\ systemdrive\windows\temp\mdbinstall log", "/qb", "/i", "$env\ systemdrive\windows\temp\mongodb database latest msi", "should install compass=0", "addlocal=router,serverservice" wait erroraction stop } catch { write host "error installing mongodb $ " foregroundcolor red } to install mongodb on another drive, you need to add — "installlocation=a \mongodb" create a directory for the mongodb administration utilities powershell if ( not (test path "$env\ programfiles\mongodb\tools\\")) { new item itemtype directory force path "$env\ programfiles\mongodb\tools\\" write host "directory successfully created" foregroundcolor green } else { write host "directory already exists" } download administration utilities powershell try { (new object system net webclient) downloadfile( "https //repos passwork pro/repository/windows packages/database tools latest zip", "$env\ systemdrive\windows\temp\database tools latest zip" ) write host "administration utilities loaded" foregroundcolor green } catch { write host "error loading administration utilities $ " foregroundcolor red } in case of an error, you can download the installer manually extract the contents powershell expand archive ` path "$env\ systemdrive\windows\temp\database tools latest zip" ` destinationpath "$env\ programfiles\mongodb\tools\\" perform a shell connection check powershell cd "$env\ programfiles\mongodb\tools\\" \mongosh mongodb //localhost 27017 restoring the backup if the connection to the shell is up, restore the databases from the backup powershell cd "$env\ programfiles\mongodb\tools\\" \mongorestore drop "c \backup\mongo xxxx xx xx xx xx" and open passwork to verify that everything was done correctly