cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Rehosting Tool - Automate Extra Tasks

TomU
23-Emerald IV

Rehosting Tool - Automate Extra Tasks

After each rehosting process there are a series of steps I have to manually complete.

  • Delete the remote file server
  • Empty the contents of the visualization queues
  • Use xconfmanager to make several property changes
  • Use QueueManager to delete a bunch of extra visualization queues

Does anyone know if there is a way to script these into the rehosting process?

Thanks!

4 REPLIES 4
ChrisSpartz
13-Aquamarine
(To:TomU)

For the xconfmanager part, you can just create a windows/unix script containing the xconfmanager commands. Then, you can define that script as a task in your rehost.properties and call it as part of the rehost in project.properties. See the User-defined Script Settings section of the rehost guide.

TomU
23-Emerald IV
(To:ChrisSpartz)

For the xconfmanager part, you can just create a windows/unix script containing the xconfmanager commands.

Seems like it might be a little trickier than that.  A windchill shell is built by running Windchill.exe and then passing it a bunch of arguments.

<WT Home>\Windchill\bin\windchill.exe -w "E:\ptc\Windchill_10.2\Windchill" --java="<WT Home>\Java\jre\bin\java.exe" shell

Once that shell is created I'm not sure how the script with my xconfmanager commands would get passed to this new window.  Guess I'll have to see if I can replicate whatever that shell setup command is actually doing manually.

Any ideas on the other three areas???

GaryMansell
12-Amethyst
(To:TomU)

Hi Tom,

To run Windchill Shell commands from a Windows batch file, I do the following:

To Setup a Windchill Shell Environment in a Batch File:

SET WT_HOME=C:\ptc\Windchill

SET JAVA_HOME=C:\ptc\Java

cd /d %WT_HOME%

pushd %WT_HOME%\bin

call setvars.bat

call tools.bat

popd

<Now include any Windchill Shell Commands that you want to run by CALL statements>

I have not seen it documented anywhere but seems to work...

Rgds

Gary

ehetényi
7-Bedrock
(To:TomU)

Hi All

To easily get rid of the replication servers I use this sql:

DELETE FROM site WHERE name = '<siteName>';

DELETE FROM fvhost WHERE ida3a5 NOT IN (SELECT ida2a2 FROM site);

DELETE FROM fvmount WHERE ida3b5 NOT IN (SELECT ida2a2 FROM fvhost);

DELETE FROM rootmount WHERE ida3a5 NOT IN (SELECT ida2a2 FROM fvhost);

DELETE FROM replicavault WHERE ida3a5 NOT IN (SELECT ida2a2 FROM site);

DELETE FROM replicafolder WHERE ida3a5 NOT IN (SELECT ida2a2 FROM replicavault);

DELETE FROM replicateditem WHERE ida3a4 NOT IN (SELECT ida2a2 FROM replicafolder);

DELETE FROM fvvault WHERE ida3a5 NOT IN (SELECT ida2a2 FROM site);

DELETE FROM fvfolder WHERE ida3a5 NOT IN (SELECT ida2a2 FROM fvvault);

THIS part is deleting the files which not been revaulted from the Replica server (in case you didn't do the forcefilesynch before the rehost)

delete from applicationdata where ida3a5 in (select ida2a2 from masteredonreplicaitem where ida3a4 in (select ida2a2 from replicafolder where ida3a5 in (select ida2a2 from replicaVault)));

delete from masteredonreplicaitem where ida3a4 in (select ida2a2 from replicafolder where ida3a5 in (select ida2a2 from replicaVault));

Depending on your how large your database it may take a while. VERY IMPORTANT!! To remove Content replication rules and scheduled replication rules before you run this SQL otherwise your rehosted environment no longer starts.

(I've never tested the WVS cleanup part as I never deletes the extra queues)

Announcements


Top Tags