How do I delete workbooks older than 4 years

Description

I have managed to delete my workbooks for the last few years, but I still have workbooks from 2018? How do I delete them?
When I go to settings / life and ministry meetings / schedule, the date only goes back to 2021. So I have manage to remove up to that point. But I still have data for 2018/19/20

Screenshot


Requirements

⇒ Fill these information below:

  • Desktop OS (name and version): Windows 10
  • App OS (name and version): (if relevent)
  • TheocBase version: 2022.04.0
  • Language used: English

Hi.

Please fill the requirements!
why do you deleted it!?

Windows 10
Theocbase 2022.04.0
English.
I wish to delete due to data protection. Some have left our congregation.
Removing their names from the database, does not remove them from older workbooks.

I also get errors if I try to remove the names manualy saying “Unknown meeting part (80).
Please check the schedule for invalid or obsolete meeting parts in the week starting 27 April 2020”.

Windows 10 Pro 22H2. Thank you

Hi ronandcol, as far as I know, there is no feature function like this build in. You could try on your own risc the following, that should work.

  1. Make a database backup. Go to settings → save database → choose a folder you find the backup later
  2. Copy the following SQL script into an empty textfile (on Windows you could open a new file with e.g. wordpad etc.) and save the file for excample with the name “tb_remove_data_older_4years.txt” on your device.
DELETE FROM exceptions WHERE date2 <= DATE('now', '-48 month');
DELETE FROM lmm_assignment WHERE date <= DATE('now', '-48 month');
DELETE FROM lmm_meeting WHERE date <= DATE('now', '-48 month');
DELETE FROM lmm_schedule WHERE date <= DATE('now', '-48 month');
DELETE FROM lmm_schedule_assist WHERE date <= DATE('now', '-48 month');
DELETE FROM notes WHERE date <= DATE('now', '-48 month');
DELETE FROM outgoing WHERE date <= DATE('now', '-48 month');
DELETE FROM publicmeeting WHERE date <= DATE('now', '-48 month');
DELETE FROM publictalks_todolist WHERE date <= DATE('now', '-48 month');
DELETE FROM school_break WHERE date <= DATE('now', '-48 month');
DELETE FROM school_schedule WHERE date <= DATE('now', '-48 month');
DELETE FROM serviceMeeting WHERE date <= DATE('now', '-48 month');
DELETE FROM student_studies WHERE start_date <= DATE('now', '-48 month');
DELETE FROM unavailables WHERE end_date <= DATE('now', '-48 month');
  1. In TheocBase Settings click the button in the bottom-right corner, that says on mouse hover “Run a file provided by the Help Desk”
  2. Confirm the safety warning
  3. Choose the file you saved on your device (“tb_remove_data_older_4years.txt”)
  4. Confirm possibly error messages popping up and at least the final ok message

Thats it. All data older than 4 years (48 months) is gone. Check if everything runs well, also after new start of TheocBase. You also could change all the numbers in the script (-48) to a number you lilke, but it should be the same number in all rows. If anything goes wrong recover your database in settings with the backup you saved before.

Good luck :wink:

1 Like