Solution: Change the language of existing content objects

About

This is an example solution.

eng-GB -> eng-US

Very basic example to convert from eng-GB to eng-US

UPDATE ezcontentobject_name SET content_translation='eng-US', real_translation='eng-US' WHERE content_translation='eng-GB' AND real_translation='eng-GB';

eng-GB -> ger-DE

Very basic example to convert from eng-GB to ger-DE

UPDATE ezcontentobject_name SET content_translation='ger-DE', real_translation='ger-DE' WHERE content_translation='eng-GB' AND real_translation='eng-GB';
 
UPDATE ezcontentobject_attribute SET language_code='ger-DE' WHERE language_code='eng-GB';
 
UPDATE ezcontent_translation SET locale='ger-DE', name='Deutsch (Deutschland)' WHERE locale='eng-GB';

eng-GB -> ita-IT

Here is another example which converts all content from eng-GB to ita-IT (this example does not remove any languages from the system)

UPDATE ezcontentclass_attribute SET serialized_description_list = REPLACE( serialized_description_list, 'eng-GB', 'ita-IT' );
UPDATE ezcontentclass_attribute SET serialized_name_list = REPLACE( serialized_name_list, 'eng-GB', 'ita-IT' );
UPDATE ezcontentclass_attribute SET serialized_data_text = REPLACE( serialized_data_text, 'eng-GB', 'ita-IT' );
 
UPDATE ezcontentclass_name SET language_locale = REPLACE( language_locale, 'eng-GB', 'ita-IT' );
UPDATE ezcontentclass_name SET language_id = 3; -- <id_of your intial LANGUAGE FROM TABLE ezcontent_language>
 
UPDATE ezcontentclass SET initial_language_id = 2; -- <id_of your intial LANGUAGE FROM TABLE ezcontent_language>
UPDATE ezcontentclass SET serialized_name_list = REPLACE( serialized_name_list, 'eng-GB', 'ita-IT' );
UPDATE ezcontentclass SET serialized_description_list = REPLACE( serialized_description_list, 'eng-GB', 'ita-IT' );
UPDATE ezcontentclass SET language_mask = 3;

eng-GB -> esl-ES

Here is another more specific example which converts content from eng-GB to esl-ES and removes eng-GB language

UPDATE ezcontentclass_attribute SET serialized_description_list = REPLACE( serialized_description_list, 'eng-GB', 'esl-ES' );
UPDATE ezcontentclass_attribute SET serialized_name_list = REPLACE( serialized_name_list, 'eng-GB', 'esl-ES' );
UPDATE ezcontentclass_attribute SET serialized_data_text = REPLACE( serialized_data_text, 'eng-GB', 'esl-ES' );
 
UPDATE ezcontentclass_name SET language_locale = REPLACE( language_locale, 'eng-GB', 'esl-ES' );
UPDATE ezcontentclass_name SET language_id = 3 WHERE language_id = 5; -- <id_of your intial LANGUAGE FROM TABLE ezcontent_language>
 
UPDATE ezcontentclass SET initial_language_id = 2, language_mask = 3 WHERE initial_language_id = 4 OR language_mask = 5; -- <id_of your intial LANGUAGE FROM TABLE ezcontent_language>
UPDATE ezcontentclass SET serialized_name_list = REPLACE( serialized_name_list, 'eng-GB', 'esl-ES' );
UPDATE ezcontentclass SET serialized_description_list = REPLACE( serialized_description_list, 'eng-GB', 'esl-ES' );
UPDATE ezcontentclass SET language_mask = 3; -- <id_of your esl-ES LANGUAGE FROM TABLE ezcontent_language>
 
DELETE FROM ezcontent_language WHERE locale = 'eng-GB';

External Reference