Showing results for 
Search instead for 
Do you mean 
Reply

How to create Test env from Production Clone

Has anyone created a TC Development/test environment from a VM clone of your production environment?  I am looking for some documentation on how to go about changing all the pointers to keep TEST env exclusive from the production env. 

 

I am 4-tier TC 8.3.3.8.

 

Thanks for any insights

 

Dan

9 REPLIES

Re: How to create Test env from Production Clone

I have a production and a test environment and they were initially installed from scratch seperatly.

When we should upgrade from 2007 to TC8 we wanted to have a clone of the production and below you have the steps to clone an MS SQL database from one Teamcenter environment to another.

I think this should work for you even if I haven't made a complete clone of the production server ... actually I just made these steps today to prepare for the upcoming upgrade to TC10.  Now I see that the cloning in TC10 it's included in the TEM, which is good!

 

1 Copy the Production database

2 Copy the Volumes
   a Rename the current volume (E:\SIEMENS\Teamcenter\volumes\volume1) as a backup.
   b Copy the “volume1” directory from Tc_Prod to the new server at D:\TC_PRDCOPY_VOL\ (The volume that store the files when deploying BMIDE templates)
  c Create a volume folder on new server and copy all production volumes to this folder (Only necessary if files shall be accessible in the clone)
3 Copy TC_DATA
 a Rename the current TC_DATA (D:\TC8\tcdata) as a backup.
 b Copy the “tcdata” directory from TC_Prod to the new server at D:\TC8\
4 Rename the pom_schema file
 a In the TCDATA directory, locate the pom_schema file, which is named pom_schema_STO00-MS011SQL_TCPROD.
 b Rename the file to pom_schema_yourserver_yourSID where:
  yourserver = the hostname of your SQLServer server
  yourSID = the name of the database SID you created
  for example “pom_schema_STO00-MS012SQL_TCPRDCOPY”
5 Edit the tc_profilevars.bat file
 a In the TC_DATA directory, locate tc_profilevars.bat.
 b Make the following changes:
 c Locate the line:
 set IMAN_DB_CONNECT=infodba:jz1fOzx7w1O@DATABASE=TCPROD;SERVER=STO00-MS011SQL\MS337SQ1
 change to:
 set  IMAN_DB_CONNECT=infodba:jz1fOzx7w1O@DATABASE=[NEW DB NAME];SERVER=[NEW DB SERVER]\[NEW DB INSTANCE]
 (substitute appropriate name set for your_SID)
 Use the login information from the old tc_profilevars.bat file
 d Locate the line:
 set TC_DB_CONNECT=infodba:jz1fOzx7w1O@DATABASE=TCPROD;SERVER=STO00-MS011SQL\MS337SQ1
 change to:
 set TC_DB_CONNECT=infodba:jz1fOzx7w1O@DATABASE=[NEW DB NAME];[NEW DB SERVER]\[NEW DB INSTANCE]
 (substitute appropriate name for your_SID)
 Use the login information from the old tc_profilevars.bat file
 e Locate the line:
  set TC_DB_SERVER=STO00-MS011SQL.global.to
  change to:
  set TC_DB_SERVER= [NEW DB SERVER]
  (insert name of the machine running the SQLServer for MS SQL/Oracle_server)
 f Locate the line:
  set ORACLE_SID=TCPROD
  change to:
  set ORACLE_SID=[NEW DB NAME]
  (substitute appropriate name for your_SID)
6 Set new database password
 Run a Teamcenter command prompt that sets TC_ROOT and TC_DATA after setting correct.
 a Add this in the command:
  set TC_DB_CONNECT=infodba:[NewPassword]@[ORACLE_SID]
  E.g.  TC_DB_CONNECT=infodba:infodba@TCPRDCOPY
 b Type install –encrypt
 The output displays the encrypted password which shall be inserted in tc_profilevars.bat for IMAN_DB_CONNECT and TC_DB_CONNECT
 Copy just the password part in the part. infodba:[Password]@TCPRDCOPY

 Check connection with typing this in a new command window: install –ayt
 Should respond with “Site is already installed” if all is correct.
7 Run backup_xmlinfo from Production enviroment
 a Choose Start -> All Programs -> Teamcenter 8 -> Command Prompt.
 b Type: backup_xmlinfo –u=infodba –p=infodba –g=dba
 After the command is finished running, close the Command Prompt window.
 c Open Windows Explorer and navigate to the directory from which you ran backup_xmlinfo.
 d In a plain text editor, open the file backup.xml and leave it open for the next step.
8 Modify the FMS master file
 a Open Windows Explorer and navigate to <TC_ROOT>\fsc
 b In a plain text editor, open fmsmaster_FSC_sto00-ms402_infodba.xml
  (fmsmaster_FSC_[host-name]_[os-user].xml).
  host-name = host running Teamcenter
  os-user = operating system account used to install Teamcenter
 c In the FMS master file, replace the value that is set for the fmsenterprise id tag with the value of the enterpriseId tag found in the backup.xml file.
 d In the FMS master file, edit the volume tag with the values for the volume1 found in the backup.xml file as follows:
  volumeID (in backup.xml) = id (in FMS master file)
  wntPath (in backup.xml) = root (in FMS master file: This is the location to which you copied the Teamcenter volume named volume1.)
 e In the FMS master file, edit the transientvolume tag with the values for transientVolumeInfo found in the backup.xml file as follows:
  transVolId (in backup.xml) = id (in FMS master file)
  wntPath (in backup.xml) = root (in FMS master file: This is the location to which you copied the Teamcenter volume named transientvolume, if applicable.)
 f Open the Services window and restart the Teamcenter FSC Service and check log so all volumens are read/write verified.
9 Modify the FSC settings
 Search for all preferences containing the previous server name.
 Example given:
 In Teamcenter, change the preference settings for “FMS_BootStrap_Urls;
 Change the value FROM
 http://sto00-ms011:4544
 TO the right settings for the current server, for example (Test)
 http://[NEW SERVER]:4544
 Restart the client.
10 Modify the TcOrganization – volumes
 a Log on to Teamcenter as infodba
 b Open the Organization application.
 c For volume1, set the Node Name value to the name of the machine running Teamcenter, set the Path Name to the path of the volume.
 d Enter the FCS id from the fmsmaster file, see above, and then click Modify, see example below.
 e Verify that you can create and edit a text dataset.
 f Exit Teamcenter.
11 Verify and Modify the Database Name
 a Login to Teamcenter. Verify that the host name and database connection is correct.
  Use My Teamcenter – Help – About – More.
 b In Organization, change the Database name from “TC_Production” to the appropriate name.
12 Modify Tc_Log directory
 a In the TC_DATA directory, locate the tc_log directory, which is named
  log_STO00-MS011SQL.global.to_TCPROD.
 b Rename the file to log_[yourserver]_[yourSID] where:
  yourserver = the hostname of your SQLServer server
  yourSID = the name of the database SID you created
  for example “log_STO00-MS012_TCPRDCOPY”
13 Restart All Services and login

Re: How to create Test env from Production Clone

Jormah, Thanks for the response. I will review and let you know how it turns out.

Re: How to create Test env from Production Clone

Want to save a bunch of time?  Don't copy all the production volumes because if you're like us there's a boat load of data in your Prod volumes- just create the same volume folders on your cloned Application server and switch the volume pointers in your Organization after you login to the cloned database.  When it asks you "would you like to move the volumes?" make sure you answer "No."  I would also switch your FSC Port numbers to something unique so there's no way of cross linking the 2 databases.

Re: How to create Test env from Production Clone

True! Copy of production volumes isn't necessary in most cases. The only important is the volume were the BMIDE files are stored otherwise it will complain during a deploy ... and the compy must be done before a new deploy is made in Production.

 

Changin port is also a good proposal to avoid any misstake. I usually drops an text file into the cloned environment an checks so it's save in the correct folder.

 

Great for some activity in this forum!

Re: How to create Test env from Production Clone

 

@jormah

 

Without installing,how can we run teamcenter? Because,whatever you explained,in that we are not copying rest of the TC folders.Without them,we can't start TC.Can you please elaborate?. Test environment means,it should be installed to different system.

Re: How to create Test env from Production Clone

Hi

 

What I have done when we run TC8.3 was to make first a fresh install with all the templates I use in Production. This so I had the TC_ROOT set for this server.

Then I renamed the created tcdata folder and copied the tcdata from production and made the modifications as mentioned above.

 

But it's also possible to make a complete clone as I some weeks ago needed to change my production server to a new one due to a huge an unresolvable slowness issue. I didn't want to upgrade now to 11.2 and I wanted to make sure installation was the same.

So I did, 

* copy of TC_ROOT to the new server. (I use robocopy an /MIR to get a exact copy with same date etc on the files)
Here I uses the exact same path including same disk name in my case D:\TC10\....

* Made a db copy of the actual production db so during my adjustment on the new server.

* created the services FSC and Server Manager. (Subscription & Action manger, Module plus Dispatcher I recreated through TEM.)

* Changed the connection parameters tc_profilevars, volumes, FSC etc as earlier post describes it.

* copied necessary files from volumes to be able to make a TEM update.

* I also needed to adjust the configuration.xml file under [TC_ROOT]\install to point to the new server before launching the TEM.

* Made scan checks to find any relevant files pointing to the current prod server and changed them to the new server.

* When I could connect and also deploy a BMIDE template to the cloned environment I changed again the db connection (As it's a clone I don't need to regenerate any passwords just change the db server and db name) parameters in tc_profilevars.bat and the log folder pointing to the actual production environment.

 

And now I had a new server running the exact same Teamcenter environment.

 

Just think it through and don't stress and all will go fine!

 

 

Re: How to create Test env from Production Clone

Thanks a lot.

 

One more query, after installing fresh TC8.3 on its own database.Can i restore PRODUCTIONDB to TESTDB(fresh installation done) ?Will it allow to restore?

Re: How to create Test env from Production Clone

I newer overwrite the db from the test install so I can't say.

It may be so that you will have additional tables in the testdb if you installed something else than on the production.

So I always makes a restore of production to a new db. Only time I overwrite the current db is if I make an update of the cloned production db to have the latest info available.

Re: How to create Test env from Production Clone

Thank you.Let me try..