Content: Blog

Technical articles

Migration Options for djangocms-text-ckeditor Deprecation

Fabian Braun

Feb. 4, 2025

As we move towards a more modern and flexible content editing experience, the deprecation of djangocms-text-ckeditor is a necessary step. This guide outlines the options and detailed process for transitioning to djangocms-text, ensuring a seamless migration while leveraging the latest tools and technologies in rich-text editing.

Preparation Phase: Get to know djangocms-text

To get started with djangocms-text, begin by installing the latest version of the package of a test system where you cannot loose data:

> pip uninstall djangocms-text-ckeditor
> pip install djangocms-text

Update your INSTALLED_APPS setting to reflect the new package:

INSTALLED_APPS = [
    ...,
    "djangocms-text",
    ...,
]

By default, djangocms-text uses TipTap as its rich text editor. TipTap stores content as structured JSON, which means that not all custom HTML attributes manually added to your project will be retained.

Run migrations. Migrations will copy existing djangocms-text-ckeditor plugins to new djangocms-text plugins. The djangocms-text-ckeditor database tables will only be read and not be written to. 

djangocms-text allows for integration with different rich text editors. Depending on your project different scenarios might suit your needs better.

One new feature is relevant for the decision: djangocms-text supports "dynamic HTML" which means that it can store references to pages or other Django objects which only are resolved into actual URLs when the HTML is fetched from the database. This allows djangocms-text to have references to pages which adjust automatically when pages are, say, moved or renamed ̣⨪ also in both HTMLFields and text plugins. There is no need to add a link plugin inside the text plugin.

Scenario Evalutation

Support for text-enabled plugins Support for dynamic HTML* Support for HTML Source editing Recommended richt text editor Remarks
Yes Yes No Tiptap (default setting) Recommended for all new projects and long-term for all projects.
Yes No Yes CKEditor 4 CKEditor 4 has reached end-of live and only paid support is available from CKSource, the maker of CKEditor
No Yes Yes CKEditor 5 CKEditor 5 is available under the GPL license only. It is available through the currently experimental djangocms-text-ckeditor5 package.
We hope to extend support to text-enabled plugins with the help of the community.

* Automatically updating links, also in HTML fields.

The code base of djangocms-text is identical for all scenarios. What gets swpped out is the integration of the rich text editor package. I've summarized the different settings needed for the non-standard scenarios at the bottom.

Notes on Content Migration

Migration of existing content is always required – even if you do not switch from CKEditor4 to a different editor. Especially Tiptap will convert HTML-based content automatically to a structured JSON format used by it whenever a text plugin or HTML field is edited. Befor editing the JSON fields of the text plugins remain empty.

Validation and Optimization Phase

Comprehensive Testing:

During this phase, thoroughly test all pages, placeholders, and plugins to ensure that the migration has preserved content integrity and that everything renders consistently across the site. Pay special attention to how content is displayed in different sections to confirm that the editor handles formatting and custom styles as expected. In addition, validate functionality across multiple browsers and devices to ensure that the user experience remains consistent and accessible for all audiences.

Collect Feedback:

Gather feedback from key stakeholders, including editors and developers, to identify usability concerns or feature gaps. Editors can provide insights on how intuitive the new editor is for day-to-day content management, while developers can identify any technical issues or areas for optimization. Use this feedback to make necessary adjustments and refine the configuration of djangocms-text and its associated editor. 

Report issues and propose improvements:

Please report issues on github to help improve the experience. You are kindly invited to share any improvements by creating a pull request on github. We strive to provide an excellent editing experience, but only can achieve this with the help of the community!

Post-Migration

Monitor Performance and User Feedback:

After the migration, continuously monitor the performance and stability of djangocms-text and the chosen editor. Watch for any unexpected behavior or performance bottlenecks that may arise during regular usage. Actively collect user feedback to address concerns and ensure the solution meets their needs. Additionally, stay proactive by regularly updating to the latest version of djangocms-text and its editor to benefit from ongoing improvements, bug fixes, and contributions from the community.

Documentation Updates:

Update your internal documentation to reflect the configuration and usage of the new editor. Include detailed setup instructions, usage tips, and troubleshooting guidelines for both editors and developers. Clear, updated documentation will ensure smooth onboarding for new team members and reduce the learning curve for those transitioning to the new edit

Integration Phase

Update Dependencies  

When migrating from djangocms-text-ckeditor to djangocms-text, it is crucial to ensure that both packages are not installed at the same time. These two packages are incompatible with each other and can cause conflicts if they coexist in the same environment. To prevent potential issues, completely uninstall djangocms-text-ckeditor before installing djangocms-text. You can do this by running:  

pip uninstall djangocms-text-ckeditor
pip install djangocms-text

In addition to replacing djangocms-text-ckeditor with djangocms-text in your project’s dependencies, check for any indirect dependencies that may still reference the old package. Some third-party plugins or legacy configurations might still require djangocms-text-ckeditor, so it’s important to update those dependencies accordingly. Make sure your dependency management files (such as requirements.txt or pyproject.toml) no longer list djangocms-text-ckeditor before proceeding.  

Once the transition is complete, verify that all required plugins are compatible with djangocms-text and your chosen editor, whether it’s TipTap or CKEditor5. Fortunately, djangocms-text includes compatibility shims to handle imports of HTML fields, so most plugins should continue to function without modification. However, it's a good practice to test your setup thoroughly to ensure a smooth migration and avoid unexpected formatting issues.

Update project settings

If your project contains outdated settings related to djangocms-text-ckeditordjangocms-text will issue warnings to help identify deprecated configurations. Pay attention to these warnings, as they provide guidance on what needs to be changed. For more detailed information on configuring djangocms-text, refer to the README file included in the package.


Non-standard Scenarios

CKEditor 4

Keep using the current CKEditor 4 which has been sunset and does not receive any maintenance by its creator any more. This will keep the user-facing interface unchanged.

Requirements
djangocms-text
INSTALLED_APPS
...,
"djangocms_text",
...
Additional settings
TEXT_EDITOR = "djangocms_text.contrib.text_ckeditor4.ckeditor4"

 

CKEditor 5

Migrate to CKEditor 5 (GPL license). You can not (yet) use text-enabled child plugins inside CKEditor 5. Dynamic links are available natively, though.

Requirements
djangocms-text
djangocms-text-ckeditor5
INSTALLED_APPS
...,
"djangocms_text",
"djangocms_text_ckeditor5",
...
Additional settings
TEXT_EDITOR = "djangocms_text_ckeditor5.ckeditor5"
blog comments powered by Disqus

Do you want to test django CMS?

Try django CMS