Associate a Task Agent with a Copied Instance (prior to 7.4.12)

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

Prior to version 7.4.12, the process to re-associate the task agent is more complex.  The following steps detail the instructions for correctly associating the task agent to the current data.  These steps will require the ability to query the Astra Schedule database.

 

1.Query the Institutions table with the following and store the result in a convenient location:
 
select distinct id as InstitutionId from institutions
 
NOTE: This query will generally only return a single id, but it is possible to have multiple institutions associated with a single database.  If this is the case, the appropriate InstitutionId can be confirmed by inspecting the web.config file of the original site.

 

2.Query the TaskAgents table with the following and store the results from the top row in a convenient location:
 
select id as TaskAgentId from taskagents order by createddate desc

 

3.Query the Machines table with the following and store the results from the top row in a convenient location:
 
select id as MachineId, sharename, Version from machines order by modifieddate desc
 
NOTE: Verify that the Version column of the top row matches the current version.

 

4.Determine the Share name of the current server by navigating to the Files folder of the Task Agent installation (usually the same as the Astra Instance)
 
In Windows 2003 right click and select “Sharing and Security…”  Save this information in a convenient location.
 
Windows_SharingAndSecurity
 
In Windows 2008, right click on the files folder and select Properties.  Then click on the Sharing Tab.  Share Name is displayed at the end of the network path.
 
\\HOST\Sharename

 

5.Update the AgentURL in the TaskAgents table to use the Share name from the current server (saved during step 4) and the desired port.  Use the following update statement with the appropriate values:
 
update taskagents set AgentURL = 'taskagent://<CorrectShareName>:<desired Port, default 7474>' where id = '<TaskAgentId from step 2>'
 
NOTE: Replace the sections in bold.  Final result should look like the following:
 
update taskagents set AgentURL = ‘taskagent://AppHost:7474’ where id = ‘6F770148-1E1E-49C1-842B-80D99AF713AE’

 

6.Update the Host in the Machines table by using the following update statement with the appropriate values:
 
update Machines set Host = '<HOSTNAME of Astra Server>' where id = '<MachineId from step 3>'
 
NOTE: Replace the sections in bold.  Final result should look like the following:
 
update Machines set Host = ‘AppHost’ where id = ‘5EF181D1-0FDF-4283-8942-1CEE8F48D87C’

 

7.Stop the Astra Task Agent service for the specified instance if it is running.

 

8.In Windows Services, right click on the Astra Task Agent that was stopped and select Properties.

 

9.Under the Path to executable, copy the ID value.
 
TaskAgentProperties

 

10.Open Command Prompt (as administrator in Windows 2008) and run the following command:
 
sc delete AstraTaskAgent_<ID from Service>
 
NOTE: the final result should look like the following:
 
sc delete AstraTaskAgent_38892015-8070-4398-af12-6cddaa83b2fe

 

11.Update the Astra.TaskAgent.exe.config file by updating the following sections if necessary:
 
InstitutionId value must be set to the InstitutionId saved during step 1.
MachineId value must be set to the MachineId saved during step 3.
TaskAgentId value must be set to the TaskAgentId saved during step 2.

 

12.Save the Astra.TaskAgent.exe.config file.

 

13.Run the following query against the Astra Schedule database:
 
In MS SQL…
 
select ta.CreatedDate, 'sc.exe create AstraTaskAgent_' + LOWER(CAST(ta.Id as char(36))) + ' binPath= "C:\Program Files (x86)\Ad Astra\' + version + '\Instances\' + o.InstanceName + '\TaskAgent\Astra.TaskAgent.exe id=' + LOWER(CAST(ta.Id as char(36))) + '" DisplayName= "Astra Task Agent(' + ta.name + ' on ' + o.InstanceName + ')" ' as cmd
from TaskAgents ta
inner join Organizations o on ta.InstitutionId = o.id
,AstraVersions
order by createddate desc
 
In Oracle…
 
select ta.CreatedDate, 'sc.exe create AstraTaskAgent_' || ta.Id  || ' binPath= "C:\Program Files (x86)\' || version || '\Instances\' || o.InstanceName || '\TaskAgent\Astra.TaskAgent.exe id=' || ta.Id  || '" DisplayName= "Astra Task Agent(' || ta.name || ' on ' || o.InstanceName || ')" ' as cmd
from TaskAgents ta
inner join Organizations o on ta.InstitutionId = o.id
,AstraVersions
order by createddate desc
 
NOTE: The filepath given in the queries is for a default installation.  If Astra is installed into a different path, replace the value in the binPath section of the query to match the server filepath.

 

14.Copy the first result from the query.

 

15.In command prompt (run as administrator in Windows 2008) paste and run the value from the query in step 13.
 
NOTE: Final result should look like the following:
 
sc.exe create AstraTaskAgent_6f770148-1e1e-49c1-842b-80d99af713ae binPath= "C:\Program Files (x86)\Ad Astra7.4.12.29\Instances\NTest\TaskAgent\Astra.TaskAgent.exe id=6f770148-1e1e-49c1-842b-80d99af713ae" DisplayName= "Astra Task Agent(NTest on NTest)"

 

16.Start the new AstraTaskAgent.

Page url: ?associate_a_task_agent_with_a2.htm