Support

Home Forums Event Espresso Premium cleaning up an olod database part 2

cleaning up an olod database part 2

Posted: January 17, 2022 at 4:23 pm

Viewing 2 reply threads


Ryan Woodman

January 17, 2022 at 4:23 pm

Again, many years old installation from before EE was even EE. Has been upgraded and migrated many times and I am trying to clean it up before implementing WP user integration and creating a bridge to moodle.

I have two orphaned registrations that are locked but have no transaction, event or user assigned.

orphaned registrations

The transaction screens look alike – no references or payment:

transactions

I would like to manually unset the lock parameter in phpmyadmin since there is no transaction to delete and delete them from the dashboard. I could also drop the rows directly if that would be safe in this instance. i would need a little guidance on what tables to look at.

Please let me know what you believe would be the best procedure including anything i should double check to make sure that there are no additional references that would just create more orphans. I have a staged duplicate running from the last support ticket that i can use to test or can give you access.

In the same vein, I have orphaned registrants who were used for testing or duplicates 10+ years ago. They are not attached to events or transactions as I deleted the transactions, unassigned them from any events and deleted them from the contact list when they had 0 events. Would it be safe to delete those rows out of the tables so they are gone for good?

Thank you so much – been a big help so far.

Ryan


Tony

  • Support Staff

January 28, 2022 at 7:39 am

Hi Ryan,

Apologies for the delayed reply, I want to check into this a little further within the database and took a little longer than I expected.

The short answer to pretty much any ‘would it be safe to manually delete X from the database’ is going to be ‘maybe’, as much as I’d like to give you a yes or no, there are just too many relationships within EE for me to give you a definitive answer for each case but I’ll try and help with what I can here.

The padlock icon is shown when EE finds related data for the objects in question, it’s not a ‘flag’ in the DB which you can manually unset to allow you to delete the entity but a check to see if other data exists which then locks the deletion out.

So to give an example for registration 354 from your screenshot, that padlock is showing because Event Espresso is pulling in the related transaction and then using checking for any payments against that transaction like this:


$transaction   = $item->get_first_related('Transaction');
$payment_count = $transaction instanceof EE_Transaction
    ? $transaction->count_related('Payment')
    : 0;
//Tony - after the above if payment count > 0, lock the registration.

$item in this example being an EE_Registration.

So to remove the registration through the admin (and therefore use EE to remove all of the related data, you need to remove the payments from the transaction. Click on the TXN data value for that registration, then click the icon for each payment and remove it.

Quick example: https://monosnap.com/file/76RklJneOHSHOQYVZj8xTKdfTTOXfd

Once those have been removed from the transaction, the padlock will be removed.

Now, you mentioned there’s no transaction linked to Reg ID 354, however if that were the case you would see another error. Looking at your screenshot it looks like someone has moved the transaction details metabox into the sidebar, see here:

https://monosnap.com/file/WFkfqhh5VS85yqq4pB53gXfMx6vEhD

Click where it says ‘Transaction Details’ and drag it over to the left section, under last method of payment.

Can you see the transaction details then?

(I’ll move on to your other questions once we’ve got the above fixed)

Side note, when you click on the event name for that registration, what happens?

EE now has a feature to batch delete the related data when an event is perm deleted (yes including registrations and their related data).

Fixing/deleting orphaned data is a little more difficult, it can be done but its best done manually for the specific objects related to it.


Ryan Woodman

January 31, 2022 at 12:25 pm

No worries about the delay. For those two transactions 354 and 1646, the transaction details won’t drag over like the others. They are stuck in the sidebar panel – the procedure you described worked for all of the other abandoned or cancelled registrations but these are somehow stuck.

Clicking on the event name brings you to the events from 2015 and 2018. The “no name” registrant is the only one tied to that event for 354. The other no name 1646 has 9 additional registrants in that event. In the registrant’s screen, both of these say “no attached contact record” in the email field.

In the transaction screen there are two errors:

There is no attached contact for this transaction. The transaction either failed due to an error or was abandoned.

There is no billing info for this transaction.

The 2015 event could be deleted without issue since there is nobody else attached. The other is more complicated since there are additional registrants.

If it saves time for you, I can create an admin user for you to see what’s going on.

Viewing 2 reply threads

The support post ‘cleaning up an olod database part 2’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso