Retrieving Datasourcename from TI Processes
-
- Regular Participant
- Posts: 167
- Joined: Wed Mar 30, 2011 11:57 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: XL2010
Retrieving Datasourcename from TI Processes
Hi all,
We are currently engaged in a server transition, where we may need to go in and edit the datasourcename for every single TI process in order to redirect it to the new server path...
Is there an efficient way we can (i) extract the current datasourcename (for both client/server) from all existing TI processes and (ii) update them all to a new datasource
...without having to click into every single process manually of course!
thanks,
Matt
P.S. and yes, in hindsight we should have made the datasources dynamic from a central control cube... this will probably be Phase 2 :p
We are currently engaged in a server transition, where we may need to go in and edit the datasourcename for every single TI process in order to redirect it to the new server path...
Is there an efficient way we can (i) extract the current datasourcename (for both client/server) from all existing TI processes and (ii) update them all to a new datasource
...without having to click into every single process manually of course!
thanks,
Matt
P.S. and yes, in hindsight we should have made the datasources dynamic from a central control cube... this will probably be Phase 2 :p
-
- Posts: 98
- Joined: Sat Feb 11, 2012 11:13 am
- OLAP Product: TM1 9x, BPC, Hyperion, HANA
- Version: TM1 10
- Excel Version: Excel 2003 - 2010
Re: Retrieving Datasourcename from TI Processes
I have not done this before but I am sure this is something you could try and test for 1 TI process on your DEV server.
1) Edit the .pro using using a Notepad/Textpad type editor.
2) Often the second line of contains the TI process name.
2.1) The fourth / fifth line usually contains the original path to the Data Source Name / Data Source Name on Server, so change it to whatever you like and re start the TM1 service. The line numbers could be different .
3) Once you are successful with this , you could change this using TI, VB Script, VBA , grep , Power shell etc.
Cheers
Nick
1) Edit the .pro using using a Notepad/Textpad type editor.
2) Often the second line of contains the TI process name.
2.1) The fourth / fifth line usually contains the original path to the Data Source Name / Data Source Name on Server, so change it to whatever you like and re start the TM1 service. The line numbers could be different .
3) Once you are successful with this , you could change this using TI, VB Script, VBA , grep , Power shell etc.
Cheers
Nick
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Retrieving Datasourcename from TI Processes
If you have Vizier there is a project bulk find/replace function that can do exactly this and replace specific text within .pro, .rux, .sub, etc. within a given data directory. We have found it very useful for just such transitions.
-
- Regular Participant
- Posts: 167
- Joined: Wed Mar 30, 2011 11:57 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: XL2010
Re: Retrieving Datasourcename from TI Processes
thanks all for the feedback... I feel a little anxious about doing a global find/replace, but will give it a shot and see 

-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Retrieving Datasourcename from TI Processes
You are going to do a back up of the data folder first aren't you? Then no need to be apprehensive.fleaster wrote:thanks all for the feedback... I feel a little anxious about doing a global find/replace, but will give it a shot and see
-
- Regular Participant
- Posts: 167
- Joined: Wed Mar 30, 2011 11:57 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: XL2010
Re: Retrieving Datasourcename from TI Processes
pssh! backups are overrated :p jking... yes definitely a backup is called for 

-
- MVP
- Posts: 3241
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: Retrieving Datasourcename from TI Processes
Hello there
You might also want to take a look at these 2 articles on my website:
http://users.skynet.be/fa436118/wim/tm1 ... efiles.htm
and
http://users.skynet.be/fa436118/wim/tm1 ... cesses.htm
These are the direct links to the pages.
They do not do exactly what you need, but are helpful nonetheless.
You might also want to take a look at these 2 articles on my website:
http://users.skynet.be/fa436118/wim/tm1 ... efiles.htm
and
http://users.skynet.be/fa436118/wim/tm1 ... cesses.htm
These are the direct links to the pages.
They do not do exactly what you need, but are helpful nonetheless.
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Regular Participant
- Posts: 164
- Joined: Tue May 04, 2010 10:49 am
- OLAP Product: Cognos TM1
- Version: 9.4.1 - 10.1
- Excel Version: 2003 and 2007
Re: Retrieving Datasourcename from TI Processes
Hi,
A couple of thoughts in addition to the useful suggestions so far:
A couple of thoughts in addition to the useful suggestions so far:
Assuming we're talking about file paths, could the server guys not manage this better for you at lower level (ie DNS etc)? I'm guessing by your use of "may need" that you've already thought of this but worth asking the question if you hadn't.fleaster wrote:Hi all,
We are currently engaged in a server transition, where we may need to go in and edit the datasourcename for every single TI process in order to redirect it to the new server path...
If you're going down a find and replace route anyway, might this not be an opportunity to attack this? Creating a control cube and then replacing existing code with a CellGetS might not add too much overhead.fleaster wrote:P.S. and yes, in hindsight we should have made the datasources dynamic from a central control cube... this will probably be Phase 2 :p
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Retrieving Datasourcename from TI Processes
This task is a massive PITA and some time ago I wrote this VBScript that will help you do this. You can call it from the command line like this (the three arguments are 1. data directory folder, 2. string to find, 3. new string)fleaster wrote:Is there an efficient way we can (i) extract the current datasourcename (for both client/server) from all existing TI processes and (ii) update them all to a new datasource
Code: Select all
cscript "E:\Scripts\multi_find_replace.vbs" "E:\TM1Data\tm1server" "\\some_network_share\" "\\some_new_network_share\"
Code: Select all
cscript "E:\Scripts\multi_find_replace.vbs" "E:\TM1Data\tm1server" "YOUR_OLD_ODBC_DSN" "YOUR_NEW_ODBC_DSN"
For the code below - you just need to open notepad, paste this in, and save it as multi_find_replace.vbs.
Code: Select all
Option Explicit
Const ForReading = 1
Const ForWriting = 2
Dim objFs
Dim objFolder
Dim objFiles
Dim objFile
Dim objTs
Dim strInputFolderName
Dim strSearchTerm
Dim strReplaceTerm
Dim strCurrentText
Dim strNewText
'get command line arguments
If WScript.Arguments.Count <> 3 then
WScript.Quit
Else
'set input and output folders paths and names
strInputFolderName = WScript.Arguments(0)
strSearchTerm = WScript.Arguments(1)
strReplaceTerm = WScript.Arguments(2)
End If
'WScript.Echo strInputFolderName
'WScript.Echo strSearchTerm
'WScript.Echo strReplaceTerm
'create file system object
Set objFs = CreateObject("Scripting.FileSystemObject")
'set input folder object
Set objFolder = objFs.GetFolder(strInputFolderName)
Set objFiles = objFolder.Files
'iterate files
For Each objFile in objFiles
If objFile.Type = "PRO File" Then
Set objTs = objFs.OpenTextFile(objFile.Path, ForReading)
strCurrentText = objTs.ReadAll
objTs.Close
strNewText = Replace(strCurrentText, strSearchTerm, strReplaceTerm)
Set objTs = objFs.OpenTextFile(objFile.Path, ForWriting)
objTs.WriteLine strNewText
objTs.Close
End If
Next
'clean up
Set objTs = Nothing
Set objFile = Nothing
Set objFiles = Nothing
Set objFolder = Nothing
Set objFs = Nothing
WScript.Quit

Robin Mackenzie
-
- Regular Participant
- Posts: 167
- Joined: Wed Mar 30, 2011 11:57 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: XL2010
Re: Retrieving Datasourcename from TI Processes
thanks all for the tips! will have a look and see which option works best... 
