Comparison between Media 1.x and 2.x

You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

The major changes between Media 1.x and 2.x so far are the following:

  • The File entity module which provides most of the underlying API has been moved to its own project at http://drupal.org/project/file_entity. When updating from 1.x to 2.x you'll need to ensure you download and enable this module separately. You will also need to ensure that the file_entity module included in the Media module directory is removed on update.
  • The Library tab in the Media browser is being converted to a Views-powered tab named 'Views library' enabled by default. The old library tab which is deprecated is named 'Library'. This means that Views is now a dependency for 2.x as well.
  • You can change which Media browser tabs appear for a field using the 'Media file selector' widget. For example, for a specific file field on your article content type, you can specify that only the 'Upload' tab can be visible. See http://www.youtube.com/watch?v=xHbTFID5tvE for how to configure this feature.
  • The 'Multimedia asset' field has been deprecated and moved to its own sub-module. Site builders are recommended to use the core Image and File fields for handling file and media (and use the 'Media file selector widget for those fields) rather than using 'Multimedia asset' fields.
  • The media widget for 2.x includes an 'Edit media' button which allows users to edit the fields on the selected file in a CTools modal window.
  • The sub module media_wysiwyg has been added to provide full WYSIWYG support for media files. This sub module also includes a CKEditor widget for embedding media if you are using CKEditor module and CKEditor library 4.3 or greater with the widget plugin.

Comments

video

ransom's picture

The video link is malformed and or missing on youtube.
Also for mobile viewers on android atleast it's nice if you use the standard youtube link because you can view it in the youtube player that way.

Thanks, not sure why I got a

Dave Reid's picture

Thanks, not sure why I got a bad link from Youtube, must have been copy/paste error.

Senior Drupal Developer for Lullabot | www.davereid.net | @davereid

Compatibility between V1 and V2?

fledev's picture

Hi, I would like to ask if the compatibility will be provided between the Version 1 and Version 2 of the D7 Media module? Will there be needed any special interactions or it will be done via the update.php script?
Thank you

upgrade path!

alexweber's picture

There will be an upgrade path! See: http://drupal.org/node/1240362#comment-5036796

Can I ask what is to be done

Sinan Erdem's picture

Can I ask what is to be done to upgrade from Media 1 to Media 2?

The obvious update code and

mpgeek's picture

The obvious update code and update db weren't enough for me. I had to write a custom drush command to migrate some table names and such. This was for a multisite, so it made sense to write a drush command that i could execute and track progress with. This was about a year ago, so it might be better by now. My only tip would be clone your production instance and practice the upgrade until you get it right.

Guess what my first project

sheldonkreger's picture

Guess what my first project is? Thankfully, this is not a multisite. But, we'll see how it goes.

:-)

Upgrade from Media 1 to Media 2

sheldonkreger's picture

I successfully upgraded to Media 2.0-alpha2 on an enterprise level site. This is somewhat tricky to execute, since there it requires an update of File Entity, too. File entity must be upgraded first. Then, a cron job is required to allow File Entity to classify the site's existing files into its file types (image, video, etc). Then, we can proceed to enable media and related modules.

Here is a step-by-step outline of what I did to accomplish this cleanly. I also cleared caches between many of the steps below (for example, after enabling a module).

  1. Disable media and file entity modules (this will disable brightcove_media, media_internet, and so on).
  2. Uninstall media and file entity modules.
  3. Remove, download, and enable the newest version of File Entity (2.0-alpha2).
  4. Run cron via drush elysia-cron.
  5. Remove, download, and enable Media 2.0-alpha2.
  6. Enable each sub-module of Media one by one.

There were no updates listed when I ran drush updb. What's important is enabling the File Entity module first, running cron, then moving onto the Media module. Otherwise, drush started throwing missing DB table errors and my site crashed.

Worked without snags. Thanks

t_en's picture

Worked without snags. Thanks for sharing! Comments:
1. The media module needs to be disbled before the file_entity module can be disabled.
2. I did not want to loose anything, so I skipped the uninstall step.
4. I used plain "drush cron".
There were lots of updates now, so make sure to run "drush updatedb" after enabling the modules.

Successfully migrated to

tz_earl's picture

Successfully migrated to Media 2.0 by following the described steps.

As of this writing the following versions work together on our site.

file_entity 7.x-2.0-alpha3
media 7.x-2.0-alpha3

We are also using these two modules which depend on media module:

media_youtube 7.x-2.0-rc4
media_vimeo 7.x-2.0

Unsuccessful migration... ¿anyone else?

idiaz.roncero's picture

Can't get it working, following step by step.

file_entity (2.0-alpha3) install throws the following error:
DatabaseSchemaObjectExistsException: La tabla file_type ya existe.
(in english: table already exists)

If I delete the table prior to installation, file_entity gets installed but media throws errors:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'estadomental.file_display' doesn't exist: INSERT INTO {file_display} (name, weight, status, settings) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array
(
[:db_insert_placeholder_0] => image__preview__file_image
[:db_insert_placeholder_1] => 5
[:db_insert_placeholder_2] => 1
[:db_insert_placeholder_3] => a:1:{s:11:"image_style";s:15:"media_thumbnail";}
)

I ran cron (tried elisya cron and normal) and followed all the steps.

After many tries, I got it

idiaz.roncero's picture

After many tries, I got it working. In my case, it was a faulty file_entity uninstall (the version 1.4, shipped with media 1.x) that left tables that made the installation of file_entity 2.x crash.

Those tables were

file_type
file_metadata

After dropping them, it works!

How *exactly* to upgrade from 1.x to 2.x?

MattO77's picture

How exactly should I migrate between 1.x and 2.x if you already have content associated with the Media module?

I installed Media 2.x and all other required modules, but now many sections of my admin panel are giving me errors about things not found etc. I assume there is no real smooth way to upgrade? (At least, not yet? an ETA would be great)

Please see my comment above

sheldonkreger's picture

Please see my comment above if you are still working on the Media 1 to Media 2 upgrade.

3.x?

Dustin@PI's picture

Can anyone give an update on media 7.x-1.3? it seems to be the final release of the 1.2 branch but I can't find any confirmation of that.

my site crashed

ibraaheem's picture

Hello,
I need urgent help.
From the Available Updates page, i just clicked on Download Link for a number of modules of which Media is among. Unfortunately, i did not check the branch. Now a critical portal is up-side-down. It was initially complaining about absence of table media_filter_usage; i was able to manually create that, copied from an old installation.

But i cannot install modules, upgrade modules, clear cache etc. It all results in a blank page
Please help

Please open an issue

DamienMcKenna's picture

ibraaheem,
This really isn't the discussion to go into your problem, please open a support issue on the Media module (http://drupal.org/project/issue/media) and describe what version your site used to have and what version it was updated to.

apologies

ibraaheem's picture

terrible error, was too desperate.

Is any batches available to

phponwebsites's picture

Is any patches available to upgrade from 7.1 to 7.2?

1.* to 2.* migration without uninstall

parkjh's picture

I don't suppose the module migration from 1.5 to 2.* would be possible without full uninstall, would it?
I ask because the site in question already has a significant amount of content, and I don't see a way to export and import the media data for use after migration...
Any advice would be greatly appreciated.
Thank you.

edit: https://www.drupal.org/node/2481421

Media 1.x to 2.x migration

JWBrown's picture

I successfully migrated some client sites from Media 1.x to Media 2.x using the following modules and libraries:

Modules:

    Colorbox 7.x-2.8
    File entity 7.x-2.0-beta1
    Media and Media WYSIWYG 7.x-2.0-alpha4
    WYSIWYG 7.x-2.2+57-dev (also works with 7.x-2.2+63-dev)
    NO Media Colorbox module -- this module is deprecated for Media 2.x

Libraries:

    Colorbox library: 1.x
    CKEditor library 4.4.7.3a35b3d, including 4.4.7 widget plugin

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, Media Bulk Upload, and File Entity 

1.* to 2.* migration SUCCESS!

parkjh's picture

I also somehow manage to migrate without uninstalling using a bit of a hack.
The issue was with file entity module's update hook function 7200, where the table for "file media alt/title text" were created but not the field instance.
So it was throwing pdo exception, preventing the rest of the updates to follow through.
The hack was that I commented out the internal update function for 7200, and put the code that creates field instances in a separate module...
And it's so far so good during testing, but still weary of what might happen on the next update.
At least in my case the media module did not have any other dependent modules, which made the migration a little easier.

JW Brown Recipe worked for me!

chandraswami's picture

[2015-08-01]
[GoDaddy-Webserver-Linux-Red-Hat]
[Drupal-7.38]

I just tried to upgrade from Media_Module-7.x-1.3 to Version-7.x-2.0-beta1, and this post by JW Brown worked for me with no hitches. However, I did not have a great deal of content yet, because my site is still just being developed.

Many of these Media_Module sub-modules I did not have installed, but now they are.

So far so good. Hope nothing blows up later. If it does, I will update this post.

Library View

fgjohnson's picture

7.x-2.0-alpha4

What makes the thumbnail selectable?
I would like to change the view of the "Library" display to be a table and still select the image for submission?

Library View

fgjohnson's picture

7.x-2.0-alpha4

What makes the thumbnail selectable?
I would like to change the view of the "Library" display to be a table and still select the image for submission?

If this is incorrect place for this question please let me know.

It's javascript as far as I

markconroy's picture

It's javascript as far as I know.

I haven't looked very deeply, but I think it's coming from this file: http://cgit.drupalcode.org/media/tree/js/media.browser.js