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 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.