loading table of contents...

4.3.3. Renaming Content Types

The Content Server does not support automatic renaming of content types, as it is hard to detect this situation without additional operator assistance. In the following, you find a description to consistently rename content types in the doctypes.xml file and in the database.

  1. Make sure that all Replication Servers (and other repository listeners) are idle, that is, that there are no pending events in the Content Server's ChangeLog. Otherwise, events might refer to an incorrect content type name later.

  2. Stop the Content Management Server and all Live Servers.

  3. Rename the content type in the content type definition file, including the Parent attribute of all subtypes and the Target attribute of all LinkLists.

  4. Rename the database table that represents the content type to the new name. Depending on the database, this is possible using either an ALTER TABLE statement, or by creating a new table, copying all data, and deleting the old table.

  5. Rename occurrences of the content type name in the Resources table:

    UPDATE Resources SET documentType_ = 'myNewName' WHERE documentType_ = 'myOldName'
          
  6. Rename occurrences of the content type name in the Rules table:

    UPDATE CmRules SET docType = 'myNewName' WHERE docType = 'myOldName'
          
  7. Start the Content Servers.

Note that you may have to adapt various parts of your application, such as Queries stored in the repository, template file names and EL expressions in templates, generated ContentBeans etc.

If point 1 (idle repository ChangeLog) cannot be ensured, you can proceed as follows:

  1. Truncate the ChangeLog as far as possible, as described in Section 3.12, “Truncate the ChangeLog”.

  2. Update all ChangeLog entries that refer to content type names (the column depends on the event code):

    UPDATE changelog SET s2='myNewName' WHERE s2='myOldName' AND i1 IN (1, 2);
            

    UPDATE changelog SET s1='myNewName' WHERE s1='myOldName' AND i1 IN (36,37);
            

  3. After restarting the Content Server, all clients connecting to this server will only see the new content type name in content repository events.