Requirements:Right Fields to Custom Fields Migration

From MovableType

http://www.textcnaceroutr.com This is a requirements document.

Contents

Overview

Chad Everett and the community have assembled an upgrade script for moving data stored by the Right Fields plugin to the official Movable Type Custom Fields plugin. It properly migrates data stored in PluginData blobs and data stored directly in SQL tables. However, this script is incomplete, and consequently there are a number of people who have yet to migrate from MT3 to MT4.

Let's complete this essential upgrade tool to help those users move to the latest version of MT.

Problem Statements

  • The solution available does not migrate RightFields "File" fields into Custom Fields in a way that preserves the ability to translate the filenames into URLs in template code.
  • The solution available does not migrate RightFields "Linked Entry" fields. No equivalent exists in CF.
  • Custom Fields requires field IDs to be unique across the entire system, whereas RightFields field IDs must be unique only within a blog.

Requirements

Implement a plugin that provides additional conversion of RightFields data to Custom Fields, in addition to the conversion provided in Chad Everett's plugin.

Existing plugin functionality

These requirements are already solved by Chad Everett's plugin.

  • The existing plugin provides an action in its system plugin settings to initiate conversion.
  • Once activated, the existing plugin will convert existing RightFields to equivalent Custom Fields.
    • The existing plugin will convert RightFields for each blog in the system into equivalent Custom Fields.
    • The existing plugin will move RightFields data stored in MT::PluginData records to the new corresponding Custom Fields.
    • The existing plugin will move RightFields data stored in real database tables to the new corresponding Custom Fields.

Additional migration functionality

  • The plugin will migrate RightFields "Linked Entry" fields to Custom Fields, if the Linked Entry Custom Field (LECF) plugin is present.
    • If no Linked Entry fields are present, we require no additional action of the plugin.
    • If Linked Entry fields exist but the LECF plugin is not present, the plugin will present an error to the user.
    • If Linked Entry fields exist and the LECF plugin is present, the plugin will convert Linked Entry fields to custom fields as defined by the LECF plugin.
  • The plugin will migrate RightFields "File" fields to Custom Fields.
    • Uploaded files should be converted into Assets.
    • If a particular Asset type is available for the type of uploaded file, the plugin should use that Asset type. For example, if a .jpg file has been uploaded to a File field, that field value will be converted into an Image Asset.
  • The plugin will look for RightFields fields in different blogs that have the same name.
    • If the plugin finds fields with the same name but different type specifications, the plugin will migrate each as blog level custom fields, appending each with a serially generated number as necessary to meet the uniqueness constraint.
    • If the plugin finds fields with the same name, and all such fields have the same type specification, the plugin will migrate these as one system-level field, rather than rename the fields in some blogs.

Linked Entry Custom Fields

  • Engineering will produce a plugin that provides a Linked Entry Custom Field type (LECF).

Adding a LECF

  • When adding or editing a LECF, the plugin will provide options specifying which entries are selectable.
    • To fully duplicate the RightFields entry selector we must:
      • The user must select the weblog containing the entries, from any weblog available on the system.
      • The user may enter the IDs of categories the selected entry must also be in, when selected.

Editing LECF data

  • When editing an entry with a Linked Entry field, the plugin will provide a typical Custom Fields interface for selecting an entry.
    • If no entry has yet been selected for the field, the plugin will provide a "Choose Entry" button.
    • When clicked, the plugin will show a dialog from which the user may select an entry.
      • The entry selection dialog will list entries from the blog specified in the edited LECF's weblog option.
      • If the edited LECF has a category option, the entry selection dialog will list only entries that are in any category specified there.
    • When the user has selected an entry, the dialog will close and the entry's title will appear in place of the button.
    • When an entry has been selected for the field, a link reading, "Select a different entry," will appear with the entry title.
    • When clicked, the plugin will show the entry selection dialog as with the "Choose Entry" button.

Template tags

  • The plugin will make it possible for a designer to output all meta data associated with a linked entry associated with a post (title, permalink, etc).
  • The plugin will define template tags that provide equivalent functionality to RightFields' MTLinkedEntry and MTLinkingEntries tags.
    • The plugin will define the tag FieldTagNameEntry, a container tag that provides the entry context of the scoped object's linking entry, if any.
    • The plugin will define the tag FieldTagNameEntries, a looping container tag that provides the entry contexts of any entries that link to the entry already in context.
      • Objects other than entries are not available through the FieldTagNameEntries tag.
    • These tags will be multi-blog aware. That is, they will provide the corresponding blog context with the entry contexts they contain.

Resources

Quality Assurance

Test Cases

Upgrade

  • Verify that all types of Right Fields are converted to the equivalent Custom Fields.
  • Verify that all types of data in Right Fields are converted correctly when moved to Custom Fields.
  • Verify that when LECF plugin is present, linked entry fields are migrated from Right Fields to Custom Fields, and that all linked entry relationships are preserved.
  • Right Fields in all blogs should be converted to Custom Fields.
    • Doesn't seem like you can convert Right Fields to Custom Fields for only one blog at a time--is there any reason you would want to?
  • Right Fields data stored in both MT::PluginData and real database tables should be converted to Custom Fields correctly.

LECF

  • Verify that linking entries works as expected.
  • Verify that only published entries can be linked.

Test Iterations

Test 1

First test, aiming for breadth coverage, not really stressing the tool or aiming for a large database or anything.

Environment
  • Generate a blog, Blog A, with Right Fields of each type:
 Date
 Text
 Text Area
 Select Menu
 File
 Radio Button
 Checkbox
 Linked Entry
  • Generate a second blog, Blog B, with 3 entries and no Right Fields. Publish 2 and leave one unpublished.
  • Create 3 entries in Blog A, filling out each Right Field. Link 2 Blog A entries to the two published entries from Blog B, and link the remaining Blog A entry to the unpublished Blog B entry.
  • Create Template Tags for each Right Field ExtraField
  • Modify Individual Entry Archive Template to display RF data for each entry.
Note: Use both Template Tags and <MTExtraFieldValue> tags to call up RF data in the template.
  • Assign default values to some fields.
Note: Unsure whether or not default values are properly translated, so this should tell me.

Questions/Issues

  • How does the upgrade process actually work?
    • Does the upgrade plugin have to be installed before the upgrade? Doesn't seem like it.
    • Instead, I think it works like this:
      • User upgrades to 4.2.
      • Install rf2cf upgrader plugin
      • From system plugin settings, user activates the upgrade process
    • once the upgrade has been run, is the original data lost? Or can the user run it again?
  • What upgrade scenarios are supported?
    • 3.3+rf -> 4.2
    • 4.x+rf -> 4.2