Pages

Wednesday, November 23, 2022

Delete a language and its content from Optimizely CMS from the backend

You can download the database of the specific environment from the PAAS portal and install it locally 

To find the language id in your database run the SQL:

 
SELECT TOP 1000 [pkID]
     ,[LanguageID]
     ,[Name]
     ,[SortIndex]
     ,[SystemIconPath]
     ,[URLSegment]
     ,[ACL]
     ,[Enabled]
 FROM [YOUR_DB].[dbo].[tblLanguageBranch]
 
Example of deleting language - 7 is Spanish in my database

DELETE FROM [YOUR_DB].[dbo].[tblContentLanguage]
  WHERE fkLanguageBranchID = 7

   DELETE FROM [ YOUR_DB].[dbo].[tblContentLanguageSetting]
WHERE fkLanguageBranchID = 7

DELETE FROM [YOUR_DB].[dbo].[tblContentProperty]
  WHERE [fkContentID] IN (SELECT [pkID] FROM [YOUR_DB].[dbo].[tblContent] WHERE [fkMasterLanguageBranchID] = 7)

DELETE FROM [YOUR_DB].[dbo].[tblContentSoftlink]
  WHERE [fkOwnerContentID] IN (SELECT [pkID] FROM [YOUR_DB].[dbo].[tblContent] WHERE [fkMasterLanguageBranchID] = 7)

 DELETE FROM [YOUR_DB].[dbo].[tblContent]
  WHERE [fkMasterLanguageBranchID] = 7
 
 DELETE FROM [ YOUR_DB].[dbo].[tblLanguageBranch]
WHERE pkID = 7

After you confirm that it works locally, create a ticket with the customer support and then have them run these sql queries

No comments: