November Happy Hour will be moved to Thursday December 5th.

Change master language from en to en-GB

Vote:
 

Hi

Does anybody have a sql script for changing master language from en to en-GB. Important that this happens to only one of the sites (multi site solution). There are other sites with content in en (en as master language), they should not change.

Today there are no contant in en-GB. only in EN. When scipt is done there should be no content in EN only in en-GB.

Cheers

Øyvind

#144616
Feb 16, 2016 11:14
Vote:
 

Forgot to say that I am using latest episerver that is 9.6.1.0

#144617
Feb 16, 2016 11:15
Vote:
 

I usually change directly in db

Http://world.episerver.com/forum/developer-forum/EPiServer-7-CMS/Thread-Container/2013/6/Change-master-language/ 

I think there was some addon for it as well. Don't think they have support for it out of the box in CMS yet though 

#144623
Feb 16, 2016 11:56
Vote:
 

Hi i have seen that post. Will not work for me since i do not want to change all en to en-gb. I know there is no out of the box solution for this. Mayby somebody had a admin tool for this or just raw scl script for this.

I was thinging something like this

IF OBJECT_ID ( 'FixpackChangeContentLanguage', 'P' ) IS NOT NULL 
    DROP PROCEDURE FixpackChangeContentLanguage;
GO
CREATE PROCEDURE FixpackChangeContentLanguage 
    @ContentID int

AS 
declare @OriginalLanguageBranchID int
declare @NewLanguageBranchID int
declare @NewLanguageID nvarchar( 3 )

set @OriginalLanguageBranchID = 1
set @NewLanguageBranchID = 2

update tblContentLanguage
set fkLanguageBranchID = @NewLanguageBranchID
where fkContentID = @ContentID

update tblContent
set fkMasterLanguageBranchID = @NewLanguageBranchID
where pkID = @ContentID 
 
update tblContentProperty
set fkLanguageBranchID = @NewLanguageBranchID
where fkContentID = @ContentID and fkLanguageBranchID = @OriginalLanguageBranchID

exec editContentVersionList @ContentID = @ContentID

GO


EXEC FixpackChangeContentLanguage @ContentID = 5;
GO
EXEC FixpackChangeContentLanguage @ContentID = 6;
GO



I get an error when executing editContentVersionList

Msg 201, Level 16, State 4, Procedure editCreateContentVersion, Line 33
Procedure or function 'editCreateContentVersion' expects parameter '@SavedDate', which was not supplied.

Not sure how to solve this. Looks like an error in episervers script. They are not sending saveddate

/* Create a new page version for the given page and language */ EXEC @NewWorkContentID = editCreateContentVersion  @ContentID=@ContentID,  @WorkContentID=NULL,  @UserName=@UserName, @LanguageBranch=@LanguageBranch
/* TODO - check if we should mark page version as published... */

#144628
Edited, Feb 16, 2016 12:30
Vote:
 

This seems to work fine. I have to restart iis to update the three. Thats not so nice. but everything else seems fine

IF OBJECT_ID ( 'FixpackChangeContentLanguage', 'P' ) IS NOT NULL 
    DROP PROCEDURE FixpackChangeContentLanguage;
GO
CREATE PROCEDURE FixpackChangeContentLanguage 
    @ContentID int

AS 
declare @OriginalLanguageBranchID int
declare @NewLanguageBranchID int
declare @NewLanguageID nvarchar( 3 )

set @OriginalLanguageBranchID = 1
set @NewLanguageBranchID = 2

update tblContentLanguage
set fkLanguageBranchID = @NewLanguageBranchID
where fkContentID = @ContentID

update tblContent
set fkMasterLanguageBranchID = @NewLanguageBranchID
where pkID = @ContentID 
 
update tblContentProperty
set fkLanguageBranchID = @NewLanguageBranchID
where fkContentID = @ContentID and fkLanguageBranchID = @OriginalLanguageBranchID

update tblWorkContent
set fkLanguageBranchID = @NewLanguageBranchID
where fkContentID = @ContentID and fkLanguageBranchID = @OriginalLanguageBranchID

GO

EXEC FixpackChangeContentLanguage @ContentID = 4004;
GO


Does this cover everything. Dont like to do hacks like this :)

#144631
Edited, Feb 16, 2016 13:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.