close

Filter

loading table of contents...

Content Server Manual / Version 2010

Table Of Contents

4.3.5 Deleting Content Types

Caution

Caution

Before you delete content types, make sure that the data is no longer needed.

Preliminary Considerations

Deletion of content types is a challenging task, mostly because of structs (see Section 4.3.2, “Struct Properties”) and content versions:

  • A struct might have a link property to the to-be-deleted content type. If this link property is not used (= does not link to an actual content), it is hard to find and change. If you delete the content type and start the server, you will get problems.

  • Older versions of a content might link to the to-be-deleted content type. You can use the cleanversions tool (see Section 3.13.2.3.2, “Clean Versions”) to delete older versions, but the tool makes some exceptions which complicate the task, especially for newly referenced versions.

Due to the aforementioned challenges, CoreMedia recommends not deleting the content type immediately, but to follow these steps:

  1. Discontinue the use of the content type in your team.

  2. Disable the creation of the content type in Studio (see Section 7.3.6, “Excluding Document Types from the Library” in Studio Developer Manual) and disable the selection of the content type in the struct editor.
  3. Delete content items of the to-be-deleted content type from the repository. Follow the description in Section “Deleting content from the repository”.

  4. Wait a few weeks or more for sufficient editorial changes, so that more and more versions referring to outdated content type are replaced by new ones. The longer you wait, the easier the subsequent steps are.

  5. Use cleanversions to delete older versions which might still refer to the to be deleted content type. Follow the steps described in Section “Deleting older version with cleanversion”.

  6. Delete the content type and all references from the content type definition file and the database. Follow the description in Section “Deleting content type from database and content type definition”.

Deleting content from the repository

Delete all content items of the to-be-deleted content type from the content repository.

  1. Use a JShell script or a UAPI client to select all content items of the content type to delete.

  2. Find all referrers to this content (from link lists, richtext fields, Structs...) and decide what to do (delete the link, link to other content,...). For link lists you can use the validate-link-type tool (see Section 3.13.1.10, “Validate Link Type”).

  3. Find all link or link list properties in struct properties whose link type is the to-be-deleted content type. Change the link type or remove the properties.

  4. Publish all changed content, so that no old version is a latest published version.

  5. Withdraw all to-be-deleted content.

  6. Delete the content.

Deleting older version with cleanversion

At this point, you have deleted all content items of the to-be-deleted content type from the repository. No other current content item links to this type. However, there might be older versions of content items which still link to the type.

You can use cleanversions to delete these older versions. However, all content versions which are still in use will not be deleted (read the section about default exclusions in Section 3.13.2.3.2, “Clean Versions”).

  1. Run cm cleanversions (see Section 3.13.2.3.2, “Clean Versions”) to clear any unused versions. If you do not want to apply it globally, search for all document versions containing links in Struct properties whose link type is the to-be-deleted content type. Ensure to use --keep-number=1 to delete as many versions as possible.

  2. Validate content state using UAPI tooling to see contents/versions which are still blocking deletion.

  3. When there are still blocking content/version, consider the following options:

    • Especially in multi-site scenarios you might have to abort existing translation workflows and trigger a new translation workflow with the current content version.

    • Wait some more time to get rid of the blocking versions and start again with step 1.
    • Decide on alternative actions to get rid of remaining contents/versions.

Deleting content type from database and content type definition

Now, you have removed all content items of the to-be-deleted type from the repository and no other items link to the type. Delete the last occurrences of the type in rules and from the recycle bin and ultimatively from the content type definition file.

  1. Delete all rules that are attached to the document type by using the User Manager or by setting the following SQL statement (stop the Content Servers before applying the SQL statement). You have to apply the SQL statement at all Content Server databases:

    DELETE FROM CmRules WHERE doctype = '<docTypeName>';

    If the rules are deleted by using SQL, all servers and clients need to be restarted, as the document type is being cached.

  2. Use the cleanrecyclebin utility to remove all the content items from the recycle bin.

  3. Stop the Content Management Server and the Live Servers.

  4. Remove the content types to delete from the content types definition files of all Content Servers. Change the LinkType property of link list properties to a new content type.

  5. Verify that the table which represents the content type is empty (see Section 4.3.1, “The Database Schema” for details about the database schema).

  6. Drop the table which represents the content type from the databases.

  7. Start the Content Servers again.

Search Results

Table Of Contents