Last updated 19 May 2017. Created on 1 May 2015.
Edited by Michael-IDA, capysara, nerdcore, ChaseOnTheWeb. Log in to edit this page.

There is a number of notable differences between the 1.x and 2.x branch. See the wiki page for detailed information: https://groups.drupal.org/node/215218

Note: This documentation was written prior to the 2.x stable release and some of the information may no longer apply. There is also a discussion ongoing to develop this documentation in the Issue Queue: #2082037: Document Upgrade Path from Media 1.x to Media 2.x/3.x

DO NOT FOLLOW THE BELOW UNTIL YOU HAVE READ ALL OF THE ABOVE LINK! Read especially the comments on both this page and the “Document Upgrade Path from Media 1.x to Media 2.x/3.x” page. Good Luck...

Overview

Upgrading the Media from 7.x-1.x from 7.x-2-x is a convoluted process especially if you use modules such as Views and Features, as the change to the field type have knock-on effects on them.

Upgrading the module to the 2.x branch requires the following steps:

1. Convert image fields into file fields

Because the 2.x branch handles images via the File Entity module, each image field needs to be converted to a file field if you wish to continue managing images attached to those fields using the 2.x branch of the Media module.

2. Update field settings

After changing image field to file fields, their widget and formatter settings need to be updated. By default, images attached to the converted fields won’t be manageable via Media module's media browser and you have no option to utilise the Image module’s presets so you need to configure converted file fields accordingly.

3. Update views formatters

(Only relevant for those who use the Views module)
Same as field formatters, Views’ field output also needs to be updated so images are rendered using Image module’s presets

4. Recreate features

(Only relevant to those who manage configuration through the Features module)
Because fields have been converted from one type to another, the Features module get confused and you would no longer be able to revert field bases / field instances within custom features unless previously exported configurations are updated by recreating those features.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

magicmyth’s picture

Because the 2.x branch handles images via the File Entity module, each image field needs to be converted to a file field if you wish to continue managing images attached to those fields using the 2.x branch of the Media module.

This makes it sound like Media will no longer work with the core Image field. When did this happen? I know the Media Field got deprecated long ago and those fields should be changed. Is there an issue that dealt with this? I can't find one in Media's issue queue.

ChaseOnTheWeb’s picture

I think the author is confused about what the File Entity module is. I recently dug through the code for file_entity and media, both 1.x and 2.x, trying to figure out how safe it was to upgrade. I don't see any reason why image fields wouldn't still work properly, because not all that much functionality has changed; the modules are just structured a *lot* better.

jeremygrajales’s picture

If this is a myth, doesn't that pretty much make #1 and #4 of this document unnecessary?