If you use Movable Type, there’s a good chance that you use plugins. And if you took the plugin survey, there’s a good chance that you use a plugin to add extra fields to your installation: Roughly one-third of people polled used either CustomFields or RightFields to provide some additional breathing room in your installation.
To make matters more interesting, the combined plugins accounted for roughly a third of the votes for being rolled into the core package, and easily bested all other plugins when it came time to choose just one plugin to install. The problem all along has been that there are two ways to add extra fields to your site. The announcement that CustomFields is now going to be part of Movable Type just makes it more complex – especially if you’re a user of RightFields. Until now.
It’s really not difficult to transfer data between the plugins, though it is a rather manual procedure, involving the setting up of the new fields in CustomFields and then writing a small script to transfer everything for you. In fact, if you look hard enough – which is to say run a search here or there – you figure out how to do it relatively quickly. But up until now, there has been no automated way to do it. Now, that all changes.
I have put together a plugin that will do everything you need and transfer your RightFields configuration and data to CustomFields – all automatically, with little user intervention. It does require a bit of work, but it’s a whole lot less than it used to be. First, a few disclaimers.
- It cannot transfer linked entry and file types, because those are not supported in CustomFields.
- It does not transfer system-wide settings, only those at the blog level.
- It does not transfer your template tags (though you can update them later).
- It does not transfer data from custom datasources, only from PluginData.
- Key-Value pairs will transfer, but they won’t work like they did.
Unfortunately, there are no warranties express or implied with this conversion. Every attempt has been made to make it easy to use and make sure that it works as advertised. But as with any data utility, you should make sure you have good back up copies of your data before beginning anything of this nature.
Now, with all that out of the way, there are a few things you need to do.
First, of course, you need CustomFields. This process should actually work with any of the MT4-compatible versions, including the beta versions. But it has only been tested with the version that comes with the newly integrated addon version of CustomFields. Consider yourself warned.
Next, you’ll need the plugin, creatively called RF2CF. You can download it here. This is not much more than a wrapper, but it’s what makes everything work easily and simply. Once you download it, you want to unpack it into your plugins directory, where you’ll have an RF2CF directory. Make sure to keep the directory structure intact, as there are some other folders underneath this one. There will be more in a minute, but you need one other piece first.
Finally, you’ll need RightFields. As you probably know, RightFields doesn’t work with MT4, so you don’t want to install it in your MT4 directory. In fact, doing so might make everything blog up. But you want to take the lib directory and copy it over into the RF2CF directory. You’ll end up with these files:
Now, you can go into your plugin settings at the blog level. As mentioned above, there is no transferring of data at the system level. This is intentional. If you need to transfer any system-level data, simply set up your system-level fields and then go to the blog level and transfer data. This is because no data is stored at the system level, so writing a transfer routine just for that configuration wasn’t worth the effort. Sorry.
Step 1 is where you transfer the configuration data. Two types of fields will not transfer: Entry Link and File Upload. This is because CustomFields doesn’t support these file types. Also, the Key-Value Pairs will transfer over as valid options, but they won’t work like they did, but you’ll want to update them later. Do not run this step more than once per blog or you will create multiple instances of the fields and that can get messy.
Step 2 is used to actually transfer the data from RightFields to CustomFields and you can run it as many times as you like for each blog. If you have a lot of data, it might look like it is not doing anything, so keep an eye on your status bar. This is because the entire script runs before it outputs data. This just has to do with the way that the template displays and everything should be fine.
Step 3 is a maintenance step and allows you to review your CustomFields configuration (you can get there through the normal link as well – it’s just there for convenience). Because the template tags do not transfer over, I would suggest reviewing your configuration and updating template tags if you need to do so.
Because the template tags used by CustomFields are vastly different than RightFields, you will need to update your templates. That is beyond the scope of this plugin. It is designed simply to make your data accessible, not to update your templates. Don’t forget to update your templates!
And in case you’re wondering, the CustomFields addon/Professional Pack will work in MTOS. You can even install it in MT 4.01 and transfer your data. I can’t vouch for everything else working, but you’ll definitely be able to get this plugin to work to move your data over.