Map tickets to events after website migration

Home Forums Ticket Products Event Tickets Plus Map tickets to events after website migration

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1498220
    Preethi Nagarajan
    Participant

    Hi there,

    Recently I’ve migrated events, tickets, organizers, venues etc from one site to another.
    I’ve migrated these with the WP All Import/Export suite so each post type is migrated individually.

    I’ve created a custom script which updates the ID in the new site to the same ID in the old site for all the post types.
    This custom mapping is necessary due to the imports being given a new ID on import which results in the different post types not being mapped together.
    In other words, without custom ID mapping, an event would import and show as having no venue, organizer etc.

    After the ID mapping, each event shows with a venue and organizer however, tickets are not mapping.

    It appears an event post contains meta data for the organizer and venue so making the id in the venue meta table matche the id of the organizer and venue ensures organizers and venues display correctly on each event.

    The tickets however, are different.
    Events don’t contain meta data pointing to a ticket.
    Instead, it almost appears as though ticket posts contain meta which points to an event and that that meta data pointing to the event is wrapped up in a serialized array.

    My question here is to inquire about exactly how tickets are referenced (or reference) events?
    I’m confused about how exactly they relate to each other in the database.
    Once I know exactly how and why a ticket is able to show up on an event, I can write some functions to update the relevant data to re-map tickets to their respective events.

    Any help or references to documentation outlining the internals of how events reference tickets will be appreciated.

    Many thanks,
    Tom

    #1500685
    Andras
    Keymaster

    Hey Tom,

    Thanks for reaching out! Let me try to help you figure this one.

    When you create a ticket it will be added to wp_posts and gets an ID. This part you already know I guess.

    Also in the wp_postmeta table a bunch of metadata will be created for the ticket. One of those is “_tribe_wooticket_for_event” which will have the the ID of the event as a value.

    For example, you created an event, which will get the ID 40 in wp_posts.

    Then you create a ticket that will get the ID 42 in wp_posts.

    Then in wp_postmeta there will be a row like this: https://cloudup.com/cM0CT5JGLGY

    This is valid for the ticket products only.

    The case for the sold tickets is different.

    Hope this helps, let me know.

    Cheers,
    Andras

    #1501198
    Preethi Nagarajan
    Participant

    Hi Andras,

    Thanks for the info, that is helpful.

    I’ve associated these IDs and can see the ticket _tribe_woocommerce_event matches the event the ticket should be displaying on though events remain as having no tickets and no attendees.

    Is the _tribe_woocommerce_event field the only postmeta field that is required to link a ticket to an event?
    Is it required for other ticket postmeta fieds to match their respective things for tickets to display, such as _tribe_wooticket_product, _tribe_wooticket_product, _tribe_wooticket_order or _tribe_wooticket_order_item?

    What about the sold tickets—how are sold tickets associated i.e. how are attendees associated to events in the database?

    Thanks,
    Tom

    #1501275
    Andras
    Keymaster

    Hey Tom,

    If you want sold tickets to be associated as well, then you are in for a long night I think.

    When an order for a ticket is placed, then there is

    • a line is created in wp_posts for the WooCommerce order itself
    • one line for each ticket in the order is created in wp_posts

    This is the wp_postmeta created for the ticket (not the order): https://cloudup.com/cp-w6hfC1CA

    The order postmeta you don’t need to worry about that much. Doesn’t contain connections to tickets.

    Note, there might be other data as well in the database, but I believe this should do it.

    A.

    #1506311
    Preethi Nagarajan
    Participant

    Hi Andras,

    Thanks for that additional information.

    I can verify ticket meta is referencing the product, order, user and, event correctly in the database, as far as I can see.
    The ID number in the meta fields for the following fields all reference valid post and order table entries which are appropriate to the ticket referencing them:
    _tribe_wooticket_product
    _tribe_wooticket_order
    _tribe_wooticket_order_item
    _tribe_wooticket_event
    _tribe_tickets_attendee_user_id

    The ticket post and it’s relative product post match in terms of title etc.
    The order post references the user referenced by the ticket.
    The wc order item references the order id of the order post which is also referenced by the ticket.

    Everything you’ve mentioned in the previous comment of what needs to be connected in order for tickets to display on an event is correct and matching however, the tickets just are not showing up on the events.

    It’s an essential that the tickets are associated to events and more over that the purchased tickets and their meta data identical on the new site as they are on the old site.

    Are there any established methods of migrating events and tickets from one site to another?
    Are there any plugins or services which can facilitate this?
    Is it possible to pass WP, FTP and/or DB credentials over for an Events Calendar developer to look at to get further clarification/give guidance etc?

    Thanks,
    Tom

    #1506404
    Andras
    Keymaster

    Hi Tom,

    I’m sorry to hear that still didn’t work out.

    Here’s one last go, which I just found.

    For each event with attendees there should be a line with ‘_transient_tribe_attendees’ meta_key in wp_postmeta. That also contains a whole bunch of info on the orders and attendees with ID references. Probably those are off.

    Try with one event that you delete this entry from the database. (This is basically a temporary storage with an expiration, so that the attendee list loads faster.) If you delete it and load the attendee page, then it will be recreated, hopefully with the right data and your attendees should be visible.

    I just tested this locally and it worked.

    Of course, creating a db backup before is recommended.

    Keeping my fingers crossed.

    Andras

    #1507770
    Preethi Nagarajan
    Participant

    Hi András,

    Excellent, that has half worked!

    Thanks for the insight into how the transients work in this instance.

    Entirely deleting the _transient_timeout_tribe_attendees and _transient_tribe_attendees entries + reloading the attendees page for a given event has recreated those entries and made the attendees available on the attendees page.

    Sadly though, all events are still showing as unticketed…

    To get the attendees to show on the attendees page, I’ve had to pull up a generic attendee page then manually add the non-ticketed event id to the URL and load that which then displays the attendees.

    Interestingly, attendee entries link to their relative order in the Status column and ticket meta is available in the Details column.

    The issue remaining is for tickets to correctly associate with their relative event so they display on each event.

    Do you have any other wisdom or ideas I could try?

    Are there any established methods of migrating events and tickets from one site to another?
    Are there any plugins or services which can facilitate this?
    Is it possible to pass WP, FTP and/or DB credentials over for an Events Calendar developer to look at to get further clarification/give guidance etc?

    Thanks,
    Tom

    #1507942
    Andras
    Keymaster

    Hi Tom,

    Sorry, I totally forgot about your questions at the end, so let me start with those.

    Are there any established methods of migrating events and tickets from one site to another?

    Not really. My suggestion would be clearing all posts, pages and postmeta, then transferring events and tickets (so their IDs can be used) and then adding the remaining content.

    Are there any plugins or services which can facilitate this?

    Not that I know of. Due to the complex connections between events, tickets and sold tickets this is quite tricky to handle.

    Is it possible to pass WP, FTP and/or DB credentials over for an Events Calendar developer to look at to get further clarification/give guidance etc?

    Unfortunately we cannot take on requests / contracts like this. However I can share with you this list of independent developers who are not affiliated with us and might be able to help you out with this.

    Sadly though, all events are still showing as unticketed…

    To get the attendees to show on the attendees page, I’ve had to pull up a generic attendee page then manually add the non-ticketed event id to the URL and load that which then displays the attendees.

    Could you possibly do a screen recording of what you are doing here, or provide some screenshots with some labels, so I can better understand what is happening?

    Thanks,
    Andras

    #1507943
    Andras
    Keymaster

    Might have found what you are looking for. Check this screenshot: https://cloudup.com/cN3slaIbGEj

    Every ticket (not the purchased ones, but the ones you create) has a wp_postmeta entry like that. If that is missing, or the ID is incorrect, then you will not see the link to the Attendees on the event list page in admin. That is if you are using WooCommerce for selling tickets. It is different when you use the build it Tribe Commerce.

    Is this what you are looking for?

    Andras

     

    #1518853
    Preethi Nagarajan
    Participant

    Hi,

    Sorry for the late reply on this.

    I need to get a little more time to be able to attendee to this but, I’ll explain what went wrong and will paste in some code for anyone else in a similar situation who stumbles on this support thread in the future.

    Thanks,
    Thomas

    #1518904
    Andras
    Keymaster

    Hi Thomas,

    Thanks for getting back to me on this. I will leave this open so you can post your reply.

    Please note though that after 3 weeks of no movement here, the topic will be closed automatically. If that happens, just open a new topic, post your reply there and add a reference url of this thread.

    Cheers,
    Andras

    #1536102
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Map tickets to events after website migration’ is closed to new replies.