|
1 | | -= Migrating from {productname} 5 to {productname} 7 |
| 1 | += Migrating from {productname} 5 to {productname} {release-version} |
2 | 2 | :navtitle: Migrating from TinyMCE 5 |
3 | | -:description: Guidance for migrating from TinyMCE 5 to TinyMCE 7 |
| 3 | +:description: Guidance for migrating from TinyMCE 5 to TinyMCE {release-version} |
4 | 4 | :keywords: migration, considerations, premigration, pre-migration |
5 | 5 | :release-version: 7.0 |
6 | 6 |
|
7 | | -// Todo |
| 7 | +== Overview |
| 8 | + |
| 9 | +{productname} has evolved significantly from version 5 to version {release-version}, introducing architectural improvements, modern UI enhancements, stricter security defaults, and updated plugin structures. This guide outlines the critical breaking changes, recommended migration action steps, and top-level configuration adjustments required to upgrade from {productname} v5 to v{release-version}. |
| 10 | + |
| 11 | +== Key Changes |
| 12 | + |
| 13 | +=== UI Themes and Skins |
| 14 | + |
| 15 | +* **Minor Adjustments**: Oxide-based skins from v5 remain mostly compatible but may require small CSS adjustments for v{release-version}. |
| 16 | +* **Impact**: Test custom skins visually, as minor DOM changes can affect layout and styling. |
| 17 | +* **Browser Support**: Internet Explorer 11 is no longer supported in v{release-version} (dropped in v6), requiring modern browsers. |
| 18 | + |
| 19 | +.Example: |
| 20 | +[source,js] |
| 21 | +---- |
| 22 | +tinymce.init({ |
| 23 | +selector: "textarea", |
| 24 | +skin: "oxide-dark", |
| 25 | +content_css: "dark", |
| 26 | +}); |
| 27 | +---- |
| 28 | + |
| 29 | +=== Plugin Ecosystem |
| 30 | + |
| 31 | +// The contextmenu plugin was absorbed into core, the options still works, see https://www.tiny.cloud/docs/tinymce/latest/contextmenu/. not sure why this is mentioned as removed. |
| 32 | +* **Moved to Core**: `paste`, `hr`, `table`, `noneditable`, `nonbreaking`. |
| 33 | +* **Removed**: `imagetools`, `template`, `colorpicker`, `contextmenu`, `legacyoutput`. |
| 34 | +* **Premium Only**: `mediaembed`, `toc` (renamed to `tableofcontents`), `advtemplate`. |
| 35 | + |
| 36 | +Plugin Migration Examples: |
| 37 | + |
| 38 | +* **contextmenu** (Removed in v5): |
| 39 | +** Replace with browser-native context menus or custom menu logic. |
| 40 | +** Consider using link:https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.editor.ui.registry/#addContextMenu[editor.ui.registry.addContextMenu] for custom right-click actions. |
| 41 | +* **bbcode** (Removed in v6): |
| 42 | +** Replace with custom parsing or server-side processing if needed. |
| 43 | +* **fullpage** (Removed in v6): |
| 44 | +** No direct replacement. Use custom templates or server-side processing for full HTML documents. |
| 45 | +* **template** (Removed in v{release-version}): |
| 46 | +** Use premium xref:advanced-templates.adoc[advtemplate] or implement custom modal dialogs for templating. |
| 47 | +* **textcolor** (Removed in v6): |
| 48 | +** Use `forecolor` and `backcolor` buttons instead. |
| 49 | + |
| 50 | +.Example: |
| 51 | +[source,js] |
| 52 | +---- |
| 53 | +tinymce.init({ |
| 54 | +selector: "textarea", |
| 55 | +toolbar: "undo redo | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify", |
| 56 | +plugins: ["lists link image table code"], |
| 57 | +}); |
| 58 | +---- |
| 59 | + |
| 60 | +=== Content Structure |
| 61 | + |
| 62 | +* **Removed**: `forced_root_block: false`. |
| 63 | +** **Requirement**: All content must be wrapped in block elements (e.g., `<p>`). |
| 64 | + |
| 65 | +.Example: |
| 66 | +[source,js] |
| 67 | +---- |
| 68 | +tinymce.init({ |
| 69 | +selector: "textarea", |
| 70 | +forced_root_block: "p" |
| 71 | +}); |
| 72 | +---- |
| 73 | + |
| 74 | +=== API and Initialization Changes |
| 75 | + |
| 76 | +// multiple toolbars still work https://www.tiny.cloud/docs/tinymce/latest/toolbar-configuration-options/#toolbarn not sure why this is mentioned as decricated |
| 77 | +* **Deprecated**: toolbar1, toolbar2, theme, skin, mobile configurations. |
| 78 | +* **New Options**: Consolidate toolbar settings and use new options like xref:content-filtering.adoc#sandbox-iframes[sandbox iframes], xref:content-filtering.adoc#convert-unsafe-embeds[convert_unsafe_embeds], and xref:accessibility.adoc#highlight_on_focus[highlight_on_focus]. |
| 79 | +* **UI API Updates**: Rewrite custom plugins using the `editor.ui.registry.*` API. Replace methods like `editor.addButton`, `editor.addMenuItem`, and `editor.windowManager.open`. |
| 80 | +* **Promise-based Methods**: `media_url_resolver` now returns a Promise, requiring async handling. |
| 81 | +* **Obsolete Options**: Remove `force_hex_color` and update `table_responsive_width` to `table_sizing_mode`. |
| 82 | + |
| 83 | +.Example: |
| 84 | +[source,js] |
| 85 | +---- |
| 86 | +tinymce.init({ |
| 87 | +selector: "textarea", |
| 88 | +toolbar: "undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | outdent indent | removeformat", |
| 89 | +toolbar_mode: "floating", |
| 90 | +sandbox_iframes: true, |
| 91 | +convert_unsafe_embeds: true, |
| 92 | +highlight_on_focus: true |
| 93 | +}); |
| 94 | +---- |
| 95 | + |
| 96 | +=== Licensing Changes (GPL v2+ and Commercial) |
| 97 | + |
| 98 | +* **Legacy License**: {productname} 5 was licensed under LGPL 2.1. |
| 99 | +* **New License**: {productname} {release-version} is licensed under GPL v2+ or a commercial license. |
| 100 | +* **Impact**: The xref:license-key.adoc[License key] option is required as part of your editor configuration if self-hosting {productname}. |
| 101 | + |
| 102 | +.Example: |
| 103 | +[source,js] |
| 104 | +---- |
| 105 | +tinymce.init({ |
| 106 | +selector: "textarea", |
| 107 | +license_key: "your-license-key" |
| 108 | +}); |
| 109 | +---- |
| 110 | + |
| 111 | +== Migration Steps |
| 112 | + |
| 113 | +. **Backup and Prepare**: Ensure comprehensive backups before upgrading. |
| 114 | +. **Update Core Initialization**: |
| 115 | +.. Remove `theme`, `skin`, and `forced_root_block: false` options. |
| 116 | +.. Consolidate toolbars. |
| 117 | +.. Review new v{release-version} defaults for security settings. |
| 118 | +. **Plugin Migration**: |
| 119 | +.. Remove deprecated plugins from your configuration. |
| 120 | +.. Update renamed plugins (e.g., `spellchecker` → `tinymcespellchecker`). |
| 121 | +.. Verify premium plugins for compatibility. |
| 122 | +. **Custom Code Updates**: |
| 123 | +.. Rewrite custom plugins using the `editor.ui.registry.*` API. |
| 124 | +.. Replace v5 API methods like `editor.addButton`, `editor.addMenuItem`, `editor.windowManager.open`. |
| 125 | +.. Update media embed handling (`media_url_resolver` API changes). see xref:media.adoc#media_url_resolver[media_url_resolver]. |
| 126 | +. **CSS Updates**: |
| 127 | +.. Remove `.mce-*` classes and use `.tox-*` classes. |
| 128 | +.. Review custom skins and stylesheets for compatibility with Oxide. |
| 129 | +. **Testing and Deployment**: |
| 130 | +.. Thoroughly test your updated configuration before production deployment. |
| 131 | +.. Validate media, iframe, and content security settings. |
| 132 | + |
| 133 | +== Additional Resources |
| 134 | + |
| 135 | +* link:https://www.tiny.cloud/docs/tinymce/latest/[{productname} {release-version} Documentation] |
| 136 | +* xref:license-key.adoc[License Key Setup] |
| 137 | +* link:https://community.tiny.cloud/[Community Forum] |
| 138 | +* link:https://github.com/tinymce/tinymce/issues[GitHub Issues] |
| 139 | + |
| 140 | +== Helpful Links |
| 141 | + |
| 142 | +To make your upgrade smooth, check the following version-specific migration guides: |
| 143 | + |
| 144 | +* link:https://www.tiny.cloud/docs/tinymce/5/migration-from-4x/[Migrating from {productname} 4 to {productname} 5] |
| 145 | +* link:https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/[Migrating from {productname} 5 to {productname} 6] |
| 146 | +* link:https://www.tiny.cloud/docs/tinymce/latest/migration-from-6x/[Migrating from {productname} 6 to {productname} {release-version}] |
| 147 | + |
| 148 | +These include deeper configuration notes, plugin replacements, and examples. |
| 149 | + |
| 150 | +== Next Steps |
| 151 | + |
| 152 | +Ensure you follow the migration steps carefully to avoid common issues like missing plugins, broken UI, and unexpected formatting changes. Consider running your updated editor in a staging environment for a complete verification before final deployment. |
0 commit comments