...
JS7 (JobScheduler 2.0) is the successor product to JobScheduler 1.x. As JS7 makes use of a JSON format
for workflows and related objects a conversion is performed by this cmdlet.
The cmdlet converts and exports JobScheduler 1.x objects to an OS directory and stores them in a JSON format.
In addition, the converted objects can be added to a .zip archive for direct import into JS7.
PREREQUISITES
The cmdlet makes use of API version 1.13.5 or later, i.e. it can be used with a JobScheduler release 1.13.5 or later.
Use with earlier JobScheduler releases is possible within limits of converted object types, however,
this is not in scope of testing of the cmdlet by SOS.
The cmdlet can be operated from any machine with a PowerShell version 5.1, 6.x and 7.x.
The cmdlet will access JOC Cockpit and JobScheduler Master running on the same or on a remote machine.
For operation of the cmdlet both ports for JOC Cockpit and for JobScheduler Master have to be accessible.
OBJECT SELECTION
The cmdlet supports a number of selections of objects based on folders and recursion, by direct specification
of object paths and by pipelining from other cmdlets, e.g. using
ConvertFrom-JobSchedulerXml -ArchivePath /tmp/export.zip -JobChain /product_demo/shell_chain
ConvertFrom-JobSchedulerXml -ArchivePath /tmp/export.zip -Directory /product_demo -Recursive
Get-JobSchedulerJob -IsStandaloneJob -Directory /product_demo | ConvertFrom-JobSchedulerXml -ArchivePath /tmp/export.zip
STANDALONE JOBS
JS7 considers standalone jobs being workflows with a single job node.
Therefore, migrating standalone jobs results in one workflow per job.
For each workflow created a schedule is added with the path and name of the job.
JOB CHAINS
JobScheduler 1.x job chains are migrated to JS7 workflows. A JS7 workflow includes both the job nodes
and the job configurations. Therefore, migrating job chains includes that the jobs that are referenced
by the respective job chain nodes are migrated to the JS7 workflow.
ORDERS
Consider the change in wording: JobScheduler 1.x orders are migrated to JS7 schedules.
Therefore an order for a job chain maps to a schedule for a workflow in JS7.
Such schedules are used by the Daily Plan service to generate individual orders for the respective dates and times of the Daily Plan.
AGENT CLUSTERS
Consider that converted JobScheduler 1.x Agent Clusters cannot be directly imported with the
import functionality of the JS7 GUI or with the respective Import-JS7InventoryItem cmdlet. Instead, the export archive
created by this cmdlet can be used with the Set-JS7Agent cmdlet to populate the Agent inventory.
For migrating Agent Cluster configuratoins consider two approaches:
* Manually map Agent Cluster to JS7 Agents:
** $map = @{}
** $map.Add( '/product_demo/Agent_Linux', @{ 'AgentId' = 'primaryAgent'; 'AgentName' = 'Agent_Linux' } )
** $map.Add( '/global/Agent_Cluster_Linux', @{ 'AgentId' = 'primaryAgent'; 'AgentName' = 'Agent_Cluster_Linux_Active_Passive' } )
* Map Agent Clusters from existing configuration:
** $agentMapping = @{}
** $agentClusters = Get-JobSchedulerAgentCluster
** foreach( $agentCluster in $agentClusters )
** {
*** if ( $agentCluster.volatile.agents[0].os.name -eq 'Windows' )
*** {
**** $agentMapping.Add( $agentCluster.agentCluster, @{ 'AgentId' = 'wintestPrimaryAgent'; 'AgentName' = ([System.IO.Path]::GetFileName( $agentCluster.AgentCluster )) } )
*** } else {
**** $agentMapping.Add( $agentCluster.agentCluster, @{ 'AgentId' = 'primaryAgent'; 'AgentName' = ([System.IO.Path]::GetFileName( $agentCluster.AgentCluster )) } )
*** }
** }
CONVERSION OUTPUT
The cmdlet can be used to store converted objects in a local directory and to create a .zip archive with converted objects.
The .zip archive can be used for import with JS7.
...
-ArchivePath <String>
Specifies the name and path of an archive file in .zip format to which converted JobScheduler objects are added.
Independent from the archive file the directory specified with the -OutputDirectory parameter contains converted objects.
The output directory is automatically removed if an archive file is specified with the -ArchivePath parameter.
Required? | false |
Position? | 1 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
...
-Directory <String>
Optionally specifies the folder for which JobScheduler objects should be returnedconverted. The directory is determined
from the root folder, i.e. the "live" directory of a JobScheduler Master.
Required? | false |
Position? | 2 |
Default value | / |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
...