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://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
Comments
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)