- Posts: 647
- Thank you received: 31
Events and Registrations Records - How to remove past events and registrations
- David Unwin
-
Topic Author
- Offline
- Platinum Member
-
Less
More
3 years 7 months ago #146317
by David Unwin
Events and Registrations Records - How to remove past events and registrations was created by David Unwin
Over the years we have had lots of events and registrations. These are all stored in our Joomla data base.
We now want to look at clearing out the old data. The way I see it there are 2 things you need to do:
1. Export the events and registrations you don't need anymore (for backup and analysis)
2. Select and delete all events and registrations that you do not need any
The problem is I can't' see an easy way to select the events and registrations I want to delete. For use we would like to delete all events and registrations more than 3 months old
For Events, there is no selection based on date i.e. select all events between January 1 and March 31.
For registrations there is a date selector, but I can't see what date is uses is it Event Date or Registration date?
Any thoughts on how we could achieve this?
Also are there any other things I should do apart from deleting the event and registration records as they are in different tables?
We now want to look at clearing out the old data. The way I see it there are 2 things you need to do:
1. Export the events and registrations you don't need anymore (for backup and analysis)
2. Select and delete all events and registrations that you do not need any
The problem is I can't' see an easy way to select the events and registrations I want to delete. For use we would like to delete all events and registrations more than 3 months old
For Events, there is no selection based on date i.e. select all events between January 1 and March 31.
For registrations there is a date selector, but I can't see what date is uses is it Event Date or Registration date?
Any thoughts on how we could achieve this?
Also are there any other things I should do apart from deleting the event and registration records as they are in different tables?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
3 years 7 months ago #146318
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Events and Registrations Records - How to remove past events and registrations
We do not have a build-in function to allow doing this easily, so you will need to run SQL commands below to delete the data (as usual, remember to make a backup of the database before running)
Regards,
Tuan
Code:
DELETE FROM jos_eb_events WHERE event_date <= "2021-06-07";
DELETE FROM jos_eb_registrants WHERE event_id NOT IN (SELECT id FROM jos_eb_events);
DELETE FROM jos_eb_field_valuesWHERE registrant_id NOT IN (SELECT id FROM jos_eb_registrants);
Regards,
Tuan
The following user(s) said Thank You: David Unwin
Please Log in or Create an account to join the conversation.
- David Unwin
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 647
- Thank you received: 31
3 years 7 months ago #146319
by David Unwin
Replied by David Unwin on topic Events and Registrations Records - How to remove past events and registrations
Hi Tuan,
Thanks for this.
There is one small error in Sql. 3rd line, there should be a space between jos_eb_values and WHERE
I ran a simulation query against the data base. The 1st two commands produced results, but the 3rd one no rows matched. Is this correct?
See screen shot attached
Thanks for this.
There is one small error in Sql. 3rd line, there should be a space between jos_eb_values and WHERE
I ran a simulation query against the data base. The 1st two commands produced results, but the 3rd one no rows matched. Is this correct?
See screen shot attached
- Tuan Pham Ngoc
- Offline
- Administrator
-
3 years 7 months ago #146323
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Events and Registrations Records - How to remove past events and registrations
It is normal in case you do not use any other custom fields (except the core fields) for the deleted events
Tuan
Tuan
The following user(s) said Thank You: David Unwin
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.