Updating Drupal 7.x websites from Media 1.x to Media 2.x

We successfully migrated some client websites, built with Drupal 7.x, from Media 1.x to Media 2.x.  This blog post is intended as reference for developers who need to do the same.

We were able to get this working using the following Modules and Libraries:

Modules:

Libraries

To update a website using drush, use the following commands:

  • cd <directory where you run drush from>
  • drush dis media -y
  • drush dis media_colorbox
  • cd <equivalent of sites/all/modules>
  • rm -rf media
  • rm -rf media_colorbox
  • cd <directory where you run drush from>
  • drush up colorbox-7.x-2.8
  • drush up wysiwyg-7.x-2.x-dev
  • drush en file_entity -y
  • drush dl media-7.x-2.0-alpha4
  • drush en mediafield media_wysiwyg_view_mode media_wysiwyg media_migrate_file_types media_internet media_bulk_upload media -y
  • drush updb
  • drush cron
  • cd <equivalent of sites/all/libraries>
  • Then update the libraries (delete old directories and recreate with the correct library versions)
  • Then set the permissions (Admin > People > Permissions) for Media permissions, Media Bulk Upload, and File Entity permissions

About Jen Brown

Jen Brown's picture
Jen is a website and software developer at Just Magic Design. She has a degree in Computer Science from Yale University and loves problem solving. Jen’s other roles include violinist, knitter, humanist, and age-grouper triathlete. She lives in Massachusetts with her husband, her two teenage sons, and their ever-so-cute canine companion, Lily the mutt. She loves snow, good science fiction novels, and Irish Breakfast tea.

3 Comments

Thanks for the article. 1 Question, after updating, did you not have to convert image fields into file fields? My content types are using image fields and I can not change to file fields because there is data that exists in image fields.
Thanks in advance

Hi Craig,

I tried to be as complete as possible in the directions I gave above. I don't remember converting image fields to file fields; I just checked a couple of the websites I converted and the content types still use image fields. So I think you will be OK.

Good luck! Jen

I'm pretty certain that having to convert image fields to file fields is a myth. I know there's a page on drupal.org that mentions having to do that, but it seems to me that the person who wrote that was confused about what the File Entity module does.

Add your comment