Support

Home Forums Event Espresso Premium Best approach to delete all registrations and transactions

Best approach to delete all registrations and transactions

Posted: August 21, 2019 at 5:10 am


ARAGATO

August 21, 2019 at 5:10 am

Here is the situation:
We have 300+ events with each event having multiple tickets.
The tickets are only viable for one season (6 months).
In one season there are about 10k registrations.

After 6 months, new tickets and datetimes will be added to the 300+ events for the upcoming season. However, in order to keep this clean and structured as well as reduce the redundant work of creating new datetimes and tickets (those have description, role check etc.), I would like to clear the system of all previous registrations and its related transactions. After that, I would just change the datetimes and ticketdates to the new season dates.

Is that a viable approach or would you recommend deleting the datetimes and related tickets, too?

What needs to be deleted from the DB? Registrations, transactions, tickets and relations? Anything else?

Obviously, one could delete the transactions and registrations via the front end. However, I would do that whole procedure rather programmatically. Are there any functions, methods, classes that you already coded that would help in this endevour?

Thank you.


Tony

  • Support Staff

August 21, 2019 at 7:55 am

Hi there,

To delete a registration you need to remove the payments related to its transaction and EE can’t do ‘cascade deletion’ right now. Meaning you can’t click to delete the registration and have EE automatically delete everything that is needed from the payments etc and then delete the registration and transactions for you, then update the datetime/ticket sold values etc.

All of that means that the answer to this:

Obviously, one could delete the transactions and registrations via the front end. However, I would do that whole procedure rather programmatically. Are there any functions, methods, classes that you already coded that would help in this endevour?

Is, in short, no.

You’d need to build most of that functionality out, remove all of the relations from the transaction, registrations etc from scratch. There are methods to do each task individually but if it were as simple as just listing out some methods we’d already have this in EE 🙂

What needs to be deleted from the DB? Registrations, transactions, tickets and relations? Anything else?

If your keeping the datetime/tickets you’d also need to update the sold values on those.

Attempting to delete this data from within the database is complex and there’s a lot of relationships you need to take into consideration, for those reasons we recommend you don’t do it this way.

What we’ve seen other users do is use a separate clean install on subdirectory for each year/season. So each season is effectively a new site with a fresh start.

That is still going to be a lot of work creating the events each year, and if you don’t need to keep the registration data you could basically just reset EE4 back to default on the current site and set it back up as a clean install if doing that.

Another option is to leave all of the data as is, go through each event, change the slug to use the previous date or something and then duplicate the events you need, setting the correct slug and dates as you go.

Say you have Event A with slug /events/event-a

Change that to Event A (2018) and the slug to /events/event-a-2018

The duplicate event you can then set to be Event A and /events/event-a again.

Make sense?

That’s still going to be a lot of work with 300 events, but much less error-prone than manually deleting all of the registration/transactions/payment/relationships and updating values within the DB manually.


ARAGATO

September 4, 2019 at 4:58 am

Thanks Tony.

The support post ‘Best approach to delete all registrations and transactions’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  ARAGATO 2 months, 2 weeks ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.