Restoring a database in another tridion instance

I have most of the way, but there seems to be a problem with permissions:

Before recovery, everything works fine in my target environment - the target has an account to log in to the TCMDBUser system, which is mapped to my tridion_cm TCMDBUser database user

There is a user TCMDBUser_DEV in my original tridion_cm database.

After restoring the .bak source to my target, TCMDBUser_DEV is lost.

I am editing the TRUSTEES table to fix MTSUser and my log journal accounts for my target environment and run the following to fix my orphaned user database:

sp_change_users_login @Action='update_one', @UserNamePattern='TCMDBUser_DEV', @LoginName='TCMDBUser' GO 

I can enter Tridion explorer and see the expected list of publications and go through the tree structure, but when I get to the folder that should contain the elements, I see nothing with an error:

and the corresponding event log error:

 Unable to get list of SDL Tridion Content Manager items. DESCRIPTION Error Code: 0x80040000 (-2147221504) Call stack: System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String) System.Data.SqlClient.SqlDataReader.GetOrdinal(String) System.Data.SqlClient.SqlDataReader.get_Item(String) Tridion.ContentManager.Data.AdoNet.DatabaseUtilities.ConvertToFieldDictionary(IDataRecord,IDictionary`2) Tridion.ContentManager.Data.AdoNet.IdentifiableObjectDataMapper.Read(TcmUri,IDataRecord,IDictionary`2) Tridion.ContentManager.Data.AdoNet.ContentManagement.OrganizationalItemDataMapper.GetListItemsPost(IDataReader,TcmUri,OrganizationalItemItemsFilterData) Tridion.ContentManager.Data.AdoNet.ContentManagement.OrganizationalItemDataMapper.Tridion.ContentManager.Data.ContentManagement.IOrganizationalItemDataMapper.GetListItems(TcmUri,OrganizationalItemItemsFilterData) Tridion.ContentManager.ContentManagement.OrganizationalItem.GetListItemsData(OrganizationalItemItemsFilter) Tridion.ContentManager.ContentManagement.OrganizationalItem.GetListItemsStream(OrganizationalItemItemsFilter) Tridion.ContentManager.BLFacade.ContentManagement.OrganizationalItemFacade.GetListItemsXml(UserContext,String,ListFilter,ListColumnFilter) Tridion.ContentManager.BLFacade.ContentManagement.OrganizationalItemFacade.GetListData(UserContext,String,EnumListKind,ListColumnFilter,String) Folder.GetListItems 
+6
source share
3 answers

As Chris mentioned, I always abandon the user from the database, and then assign the existing TCMDBUser in SQL Server the rights to the restored database. You can delete the user with the following command (in the restored database):

 EXEC sp_dropuser TCMDBUser 

Then, through SQL Server - Security - Logins, you request the properties of your TCMDBUser and in the user mapping add the following database roles: db_datareader , db_datawriter and db_ddladmin .

What I have always done in the past and works for me, I’m not sure that all this is necessary, but it’s worth a try. I think

+4
source

You will need to delete / delete the TCMDBUser_DEV file from the database, and then create a new one with the same name and password (or bind it to your DB DB). This should solve your problem.

Usually I use the delete method with MS SQL server. I believe this is due to the ownership status that TCMDBUser has in the database schema.

When your TCMDBUser user must have the following permissions for your Tridion_CM database

enter image description here

+5
source

Try creating a new custom TCMDBUser in the database and run the following command

 EXEC sp_change_users_login 'Update_One', 'TCMDBUser', 'TCMDBUser' 
+2
source

All Articles