Transfer private objects from one user to another

Ideas and tips for enhancing your TM1 application
Post Reply
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Transfer private objects from one user to another

Post by Wim Gielis »

Hi all,

I thought this TI process might be useful to others as well. I have been writing this over the past couple of days, so if anyone wants to further test it, much appreciated !

The idea is that users in a TM1 model can have private objects:
- subsets (*.sub files)
- classic views (*.vue files)
- MDX views (*.xbv files)
- application entries

These objects are stored in the TM1 data directory following the username and/or a namespace.

Transferring such objects can be easy if it's not a lot of files, but in the Applications folder structure this can occur in multiple places.
If you have many users to do, it's not much fun.
For instance, when migrating an on-premise TM1 model to the IBM cloud, this can take time.
Namespaces can change, usernames can change, hence, folder names can change.

The process uses PowerShell to copy folders and files from source user to target user.
The process also allows to transfer to a different user, in that case I implemented it as first a copy, then delete files. No Move-Item commands in PowerShell.

The keyword 'IDEM' can be used to keep the same target username as source username, or the same source username as target username (where namespaces can differ).

Also, an attribute on the }Clients dimension can be used to automatically loop over all clients and migrate the objects.

After a (short) while this topic can go to the Useful stuff subforum if it turns out to be useful :lol: at least to me it is !

The target user should just log out an log in to see the new private objects. The TM1 model does not need to be restarted.

In V12 this process will have to be revisited. If anyone wants to set it up with the TM1 REST API or tm1py or similar, go ahead and reuse my logic where possible !


Code: Select all

# If the process call is like this:

# ExecuteProcess( 'WG_transfer_private_objects', 'pUserName_Src', pUserName_Src, 'pUserName_Tgt', pUserName_Tgt, 'pRootFolder_Src', pRootFolder_Src, 'pRootFolder_Tgt', pRootFolder_Tgt, 'pClientsLoop', pClientsLoop, 'pOperation', pOperation );

# then examples can include:

# pUserName_Src = 'Gielis Wim';
# pUserName_Tgt = 'IDEM';
# pRootFolder_Src = 'ABC';
# pRootFolder_Tgt = 'Planning Analytics';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = 'ABC\Gielis Wim';
# pUserName_Tgt = 'Planning Analytics\Wim Gielis';
# pRootFolder_Src = '';
# pRootFolder_Tgt = '';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = 'Gielis Wim';
# pUserName_Tgt = 'Planning Analytics\Wim Gielis';
# pRootFolder_Src = 'ABC';
# pRootFolder_Tgt = '';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = 'Gielis Wim';
# pUserName_Tgt = 'IDEM';
# pRootFolder_Src = 'ABC';
# pRootFolder_Tgt = '';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = 'IDEM';
# pUserName_Tgt = 'Gielis Wim';
# pRootFolder_Src = '';
# pRootFolder_Tgt = '';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = 'Gielis Wim';
# pUserName_Tgt = 'CAMID("pans:u:wgielis@aexis.com")';
# pRootFolder_Src = 'ABC';
# pRootFolder_Tgt = '';
# pClientsLoop = '';
# pOperation = 'Copy (or Move)';


# pUserName_Src = '';
# pUserName_Tgt = '';
# pRootFolder_Src = '';
# pRootFolder_Tgt = '';
# pClientsLoop = 'Src=Source user from ABC';
# pOperation = 'Copy (or Move)';


# pUserName_Src = '';
# pUserName_Tgt = '';
# pRootFolder_Src = '';
# pRootFolder_Tgt = '';
# pClientsLoop = 'Tgt=Target user in de cloud';
# pOperation = 'Copy (or Move)';

Most recent code below.
Attachments
WG_transfer_private_objects.pro
(19.91 KiB) Downloaded 296 times
Last edited by Wim Gielis on Sun Feb 25, 2024 9:03 am, edited 4 times in total.
Best regards,

Wim Gielis

IBM Champion 2024
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
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Transfer private objects from one user to another

Post by Wim Gielis »

Updated version below.
Last edited by Wim Gielis on Sun Feb 25, 2024 9:01 am, edited 2 times in total.
Best regards,

Wim Gielis

IBM Champion 2024
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
User avatar
gtonkin
MVP
Posts: 1202
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Transfer private objects from one user to another

Post by gtonkin »

👍
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Transfer private objects from one user to another

Post by jim wood »

Thanks Wim. Very helpful
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Wim Gielis
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Transfer private objects from one user to another

Post by Wim Gielis »

You’re welcome Jim
Best regards,

Wim Gielis

IBM Champion 2024
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
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Transfer private objects from one user to another

Post by Wim Gielis »

I tried using TM1py and the TM1 REST API to achieve the same result.
We all know that the file system and ExecuteCommand will be out soon.

The solution suffers from being slow as well as that I cannot retrieve private application entries for a user.
Also, impersonation is also out in V12 I think so totally not sure how to proceed here.
Someone wants to give it a try as well ?

https://github.com/cubewise-code/tm1py/pull/1044
Best regards,

Wim Gielis

IBM Champion 2024
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
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Transfer private objects from one user to another

Post by Wim Gielis »

As I am not really happy with my solutions in TI and the REST API, I loaded an idea / request for assistance.

https://ibm-data-and-ai.ideas.ibm.com/ideas/PAOC-I-1340

Feel free to give it your vote.
Best regards,

Wim Gielis

IBM Champion 2024
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
MVP
Posts: 3120
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Transfer private objects from one user to another

Post by Wim Gielis »

Updated version.
WG_CLOUD_transfer_private_objects.pro
(22 KiB) Downloaded 35 times
TECH_folder for output.pro
(6.35 KiB) Downloaded 36 times
Best regards,

Wim Gielis

IBM Champion 2024
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
Post Reply