Field Types Trick when Upgrading ExpressionEngine from 2.x to 6.x
It might seem daunting but it's easier than you think!
Upgrading an ExpressionEngine website from version 2.x to version 6.x may seem like a big jump but the ExpressionEngine 6 installer is surprisingly good and jumps through the upgrade process quite smoothly.
However, there's always a "gotcha" and this is usually related to add-ons and field types.
The ExpresionEngine guide specifies that add-ons should be uninstalled before the upgrade and then replaced with the latest versions afterwards. This is OK but be careful with field types!
If you uninstall third-party fieldtypes (such as Wygwam) you will loose the data that the fieldtypes manage.
For many third-party field types, the data is stored in the database table called exp_channel_data and when a fieldtype is uninstalled it will delete the column in that table which contains its data.
If you're struggling to upgrade, and it's because an old fieldtype is causing a problem, a handy trick is to change the type of field that is managing the data and then change it back after the upgrade.
The fieldtypes (in EE2) are configured in the database table called exp_channel_fields. Using your favourite database management tool (MySQL Workbench is a good one, or PHPMyAdmin if you're working on your webserver) open up the exp_channel_fields table and look down the column named field_type. In there you'll see which fieldtypes are managing which data in the exp_channel_data table.
Make a note of any that are managed by fieldtypes that you're going to remove before upgrading and then change their field_type to "text" and save your changes. This will preserve your data when performing the upgrade.
After the upgrade is finished - install your latest add-ons and field types and then go back to the exp_channel_fields table and rename those fields back to their original fieldtype names.
Your old data should now be preserved and will re-appear.
This doesn't work if the fieldtype uses its own table for data storage, but for most cases this trick could get you out of a situation where an old fieldtype prevents the upgrade from working smoothly.
Expression Engine Tips and Tricks
ExpressionEngine is a Content Management system which is highly flexible. Why not give it a try?
- ExpressionEngine White Screen of Death
- Field Types Trick when Upgrading ExpressionEngine from 2.x to 6.x
- Getting Captcha Working
- ExpressionEngine upgrade 2.7.1 to 2.9.0
- Transcribe tips
- Using SafeCracker with AJAX and Solspace Calendar
- Creating Navigation Using Structure
- CP Loses Its Styling
- Thumbnails aren't Created in EE on a Windows Installation
- Can't Get a Template to Load from File
- How to Remove index.php on IIS
- File Cannot Be Written To Disk
- Error 500.0 Internal Server Error
- Unable to Load Site Preferences
- Your Config File Does Not Appear to be Formatted Correctly