Closed (fixed)
Project:
Date
Version:
6.x-2.4
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2010 at 15:29 UTC
Updated:
25 Jun 2012 at 08:01 UTC
I'm upgrading a site from 5.x to 6.x Drupal. The 5.x site uses the Event module but I will be using Date and Calendar on the 6.x site. I won't be converting the Event nodes as I am willing to loose information on past events.
Should I delete all the events from the 5.x database prior to upgrading to 6.x and implementing Date/Calendar?
Regards
Comments
Comment #1
jromine commentedJust did this myself. I found this article http://pingvision.com/blog/alasda/2008/drupal-upgrade-tip-converting-eve... helpful.
Comment #2
gagarine commentedThis link is dead :/
Comment #3
gagarine commentedok i found the text with google cache... I copy here for future referance.
If you're upgrading your site from Drupal 5 to Drupal 6 and were previously using the event module, you have probably realized that a lot of the supporting modules that made the event module functional (such as Event Views) have fallen by the wayside. Well, as luck would have it, much (if not all) of the functionality that the event module provides can be re-created using CCK date fields, views and the calendar module. So the only task that remains is to get your existing event content migrated over into usable CCK fields, and then configure your views to display them into a calendar display.
While there are undoubtedly other approaches to achieve this end, this is a relatively quick and painless path to get the features you want up and running.
You'll require the following D6 supporting modules:
CCK - http://drupal.org/project/cck
Date - http://drupal.org/project/date
Views - http://drupal.org/project/views
Calendar - http://drupal.org/project/calendar
Install and enable the latest revisions of these modules.
Identify the content type or types currently on your site which are used by events. The process differs slightly depending on whether the resulting CCK date fields will be located in only one content type, or shared between multiple types.
Through the CCK interface, create new date fields in your existing event content type. These are the fields into which the old event information will be migrated . For the purposes of this document, I'll call them "eventstart" and "eventend".
If you have only one content type for events, your new fields will be created in the mysql table corresponding to that type. For example, if your content type was called wine_tastings, a table called content_type_wine_tastings will exist in your database, and the fields field_eventstart_value and field_eventend_value will exist in this table.
If you're sharing the eventstart and eventend fields between multiple content types, new tables will be created to house this data. In this example, the tables would be called content_field_eventstart and content_field_eventend.
Now with a little php and mysql magic, we can populate the new field data from the event_start and event_end fields from the original event table. Because the date information is stored in slightly different formats, a little bit of transformation is required. Create a php script like the example below, and execute from the command line. This example was constructed using shared date fields across multiple content types.
Remember to ALWAYS back up your database before performing any operations like this!
Once you've got these fields populated, you should check an existing node to verify that the information has been correctly populated. Navigate to one of your event nodes, and select edit. You should see both the legacy event date information and the new CCK fields populated with the start and end dates.
If this all checks out, browse to the modules page and disable the events module. You are now free to uninstall the event module and purge any vestigial tables.
Congratulations! You have converted your event nodes to a more flexible CCK/Date setup. These fields are now available for use in views using the calendar module!
Comment #4
naught101 commentedFor reference, you don't need to do any of the above. Just install Date, Date_tools (a date sub-module), and then go to admin/content/date/tools/import, and follow the (fairly simple) instructions there. You need a release later than 2.7 - if one hasn't come out yet, use the latest -dev.
Comment #5
naught101 commentedI upgraded from drupal 5 to drupal 7 and stupidly forgot to convert to cck while on drupal 6. And date_tools doesn't include a conversion script in d7. So I modified the above to work in drupal 7:
Works fine for me.