Question Yone Moreno Jiménez · 1 hr ago

Export all tasks on a given instance using Command Line (all at once not manually one by one from the Production)

Hello,

First of all thanks for reading this question.

We are migrating our old HealthShare instance to the newest version.

We need to export all the Tasks.

We have tested:

 

do ##class(%SYS.TaskSuper).ExportTasks("1022,1023","/opt/contenedor/tasks.xml")

It outputs: 

<LIST>zExportTasks+10^%SYS.TaskSuper.1
 

And the xml is empty:

<?xml version="1.0" encoding="UTF-8"?>
<Tasks

However, when export the task manually using the Production, it outputs:

<?xml version="1.0" encoding="UTF-8"?>
<Tasks><Task>
 <Name>[...]</Name>
 <RunAsUser>[...]</RunAsUser>
 <EmailOutput>[...]</EmailOutput>
 <Expires>[...]</Expires>
 <OpenOutputFile>[...]</OpenOutputFile>
 <OutputFileIsBinary>[...]</OutputFileIsBinary>
 <SuspendOnError>[...]</SuspendOnError>
 <Suspended>0</Suspended>
 <Priority>0</Priority>
 <TaskClass>[...]</TaskClass>
 <Settings>[...]=</Settings>
 <IsBatch>[...]</IsBatch>
 <NameSpace>[...]</NameSpace>
 <TimePeriod>[...]</TimePeriod>
 <TimePeriodEvery>1</TimePeriodEvery>
 <TimePeriodDay>2</TimePeriodDay>
 <DailyFrequency>0</DailyFrequency>
 <DailyFrequencyTime>0</DailyFrequencyTime>
 <DailyStartTime>[...]</DailyStartTime>
 <DailyEndTime>[...]</DailyEndTime>
 <JobGUID>[...]</JobGUID>
 <StartDate>[...]</StartDate>
 <LastSchedule>67008,32400</LastSchedule>
 <LastStarted>67009,6960</LastStarted>
 <LastFinished>67009,6961</LastFinished>
 <Error>Success</Error>
 <MirrorStatus>1</MirrorStatus>
 <Type>2</Type>
 <RescheduleOnStart>false</RescheduleOnStart>
 <DeleteAfterRun>false</DeleteAfterRun>
 <Description>[...]</Description>
</Task>

</Tasks> 

How could we export all taks configurated on the given instance using the command line?

We have read:

https://docs.intersystems.com/iris20201/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&CLASSNAME=%25SYS.TaskSuper#METHOD_ExportTasks

https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI.Page.cls?KEY=AMIG#AMIG_migration_tasks

https://community.intersystems.com/post/updating-task-based-export-another-task

https://community.intersystems.com/post/how-move-defined-tasks-one-instance-cache-another

However we do not understand why we can not export all the tasks using the class and method:

do ##class(%SYS.TaskSuper).ExportTasks(list,file)

Please, could you help us? 

Thanks

Product version: HealthShare 2020.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2020.1.1 (Build 408U) Sun Mar 21 2021 22:21:14 E

Comments

Enrico Parisi · 1 hr ago

The first parameter is a $list, try with:

do ##class(%SYS.TaskSuper).ExportTasks($lb(1022,1023),"/opt/contenedor/tasks.xml")

Note that the documentation for the ExportTasks() method you linked in your post says:
List of task IDs to export $lb(1,2,3)

0