The free version of My Calendar supports migration from two other calendar plugins: Kieran O’Shea’s “Calendar” and The Events Calendar.
If you have either of these plugins installed and active, you’ll see an additional settings page under the My Calendar admin menu.
My Calendar will inform you how many events you have installed for your current plugin, and provide a button to start a task to import your events. This job will run in the background, and you can be free to leave and let it work.
For The Events Calendar, My Calendar will import all events and venues. If you’re also running My Tickets, the migration will also import ticket sales information. If you’re using My Calendar Pro, you’ll be invited to turn on the Hosts custom post type and import Organizers from The Events Calendar, as well.
The data managed by The Events Calendar isn’t identical to My Calendar, and if you’re using custom fields, those may not be imported. It is possible to write custom actions to copy your custom fields over to the new events, however.
A custom copy action might look something like this:
/**
* Import ACF custom fields when event is imported from The Events Calendar.
*
* @param int $post_id The Events Calendar post ID.
* @param int $event_id My Calendar event ID.
* @param int $event_post My Calendar event post ID.
*/
function custom_migrate_event_fields( $post_id, $event_id, $event_post ) {
$acf_field_names = array( 'slides', 'slides_0_upload_image', 'slides_1_upload_image', 'slides_2_upload_image', 'slides_1_video_url', 'slides_2_video_url', 'slides_3_video_url' );
foreach ( $acf_field_names as $field ) {
$meta1 = get_post_meta( $post_id, $field, true );
$meta2 = get_post_meta( $post_id, '_' . $field, true );
if ( $meta1 ) {
update_post_meta( $event_post, $field, $meta1 );
update_post_meta( $event_post, '_' . $field, $meta2 );
}
}
}
add_action( 'my_calendar_event_imported_from_tribe', 'custom_migrate_event_fields', 10, 3 );