| 3 | | This plugin includes the directory whose name is "Custom Fields". In the directory, it includes plugin defition script whose name is "customfields.pl". Both the directory and the file were *not* mistakenly named. The plugin is intended to overwrite your exisiting Custom Fields plugin. Please make sure you backup the database and the plugin directories and files before upgrading, so if *something* happens, you can go back to the original state. |
| | 3 | |
| | 4 | The plugin is intended to overwrite your exisiting Custom Fields plugin. This plugin includes the directory whose name is "Custom Fields", in the directory there is a plugin defition script whose name is "customfields.pl"; both the directory and the file were *not* mistakenly named. |
| | 5 | |
| | 6 | Please make sure you backup the database and the plugin directories and files before upgrading, so if *something* happens, you can go back to the original state. |
| | 7 | |
| | 8 | Jessee Gardner (with help from Six Apart's David Phillips aka TweezerMan) wrote a great CustomFields migration tutorial at: http://www.movabletweak.com/app/migrating_customfields_movable_type.php. The steps are repeated here |
| | 9 | |
| | 10 | 1. Remove existing CustomFields plugin |
| | 11 | |
| | 12 | $MTDIR/plugins/CustomFields |
| | 13 | |
| | 14 | 2. Install the CustomFieldsUpgradeAssistant plugin. This upgrade plugin has the same name as the original plugin and should be placed in the same location as the original plugin. |
| | 15 | |
| | 16 | 3. Removing orphans via MySQL. |
| | 17 | |
| | 18 | Arvind's plugin didn't delete custom field data when the objects it was attached to were deleted. These two MySQL queries will remove that data: |
| | 19 | |
| | 20 | DELETE FROM mt_plugindata WHERE |
| | 21 | LEFT( plugindata_key, 6 ) = 'entry_' |
| | 22 | AND plugindata_plugin = 'CustomFields' |
| | 23 | AND (SELECT entry_id FROM mt_entry |
| | 24 | WHERE LEFT( plugindata_key, 6 ) = 'entry_' |
| | 25 | AND plugindata_plugin = 'CustomFields' |
| | 26 | AND SUBSTRING( plugindata_key, 7 ) = entry_id) IS NULL; |
| | 27 | |
| | 28 | DELETE FROM mt_plugindata WHERE |
| | 29 | LEFT( plugindata_key, 1 ) = '_' |
| | 30 | AND plugindata_plugin = 'CustomFields' |
| | 31 | AND (SELECT author_id FROM mt_author |
| | 32 | WHERE LEFT( plugindata_key, 1 ) = '_' |
| | 33 | AND plugindata_plugin = 'CustomFields' |
| | 34 | AND SUBSTRING( plugindata_key, 2 ) = author_id) IS NULL; |
| | 35 | |
| | 36 | 4. Fix a bug in Custom Fields |
| | 37 | |
| | 38 | Open $MTDIR/addons/Commercial.pack/lib/CustomFields/Util.pm |
| | 39 | |
| | 40 | Go to line 322, which looks like this: |
| | 41 | |
| | 42 | my $text = ($entry->text || '') . "\n" . ($entry->text_more || ''); |
| | 43 | |
| | 44 | And change to: |
| | 45 | |
| | 46 | my $text = ($obj->text || '') . "\n" . ($obj->text_more || ''); |
| | 47 | |
| | 48 | 5. Access your MT install, and you will be prompted to upgrade. Click "upgrade" and you're done with the upgrade. |