User documentation

  1. Home
  2. User documentation
  3. Booking Activities (advanced)
  4. Archive old events and bookings

Archive old events and bookings

Booking Activities allows you to make and manage a huge amount of bookings and events. But you may encounter slowdowns if they are too many of them. In such case, you may find it useful to archive the oldest ones to reduce the amount of data to treat.

Booking Activities provides an archiving tool.

Before using it, you must have in mind that deletion commands will be executed on your data. You are the only responsible of any data loss that may occur during this process.
It is your responsability to backup and restore your data if a problem occurs. This guide will help you limiting the risk of data loss, but it doesn’t give you any guarantee.
Finally, understand that archived data may not be compatible with later versions of Booking Activities.

 

1. Put your website in maintenance mode

Deleting a lot of data will lock your database tables, your server won’t be able to do anything else.
You can use a plugin such as Slim Maintenance Mode to allow only administrators to see the website.

 

2. Backup your database, twice

Now, we will make two manual backups of your database: a complete one, and a partial one.

  • Go to your server control panel
  • Go to phpMyAdmin and log in
  • Select your database

Complete backup
In fact, Booking Activities will only affect a few tables. But we want to be sure that you can restore your database exactly as it was in case of problem.

  • Go to the “Export” tab
  • Select the “Custom” export method
  • Make sure that all tables are selected
  • In “File name template”, input %Y-%m-%d-@DATABASE@-complete
  • In “Compression”, select “gzipped”
  • Keep everything else by default
  • Click on “Go”
  • Your backup file will be downloaded, keep it safely in a directory of your computer

Partial backup
Now let’s backup only what we need.

  • Go to the “Export” tab again
  • Select the “Custom” export method
  • Select these tables only: bookacti_bookings, bookacti_booking_groups, bookacti_events, bookacti_event_groups, bookacti_exceptions, bookacti_groups_events, bookacti_meta
  • In “File name template”, input %Y-%m-%d-@DATABASE@-partial
  • In “Compression”, select “gzipped”
  • Keep everything else by default
  • Click on “Go”
  • You backup file will be downloaded, keep it in the same directory as the previous one

 

3. Archive data prior to a date

Now you can use Booking Activities archiving tool.

  • Go to Booking Activities > Settings > System tab
  • Select a past date. All events and bookings prior to this date will be archived

3.1.: Analysis

  • Click on “Analyse”
  • Validate the dialog
  • You will be given the number of bookings and events that will be archived
    • Above a total of 100.000, you should make several small backups (of about 50.000) instead of one big. Select an earlier date and try again
  • Keep a note of how many events and bookings will be archived, it will be useful at step 5 and 6

3.2.: Backup

  • Click on the new “Archive” button
  • Data are now stored in a backup file. You can find it in the table below
  • Make sure that the amount of backed up data correspond to the analysed amount
  • Download it, extract it, and make sure that the files contain data consistent with the results of the analysis

3.3.: Data deletion

  • Click on the new “Clean” button
  • Wait for the loading to end. It may take several minutes, according to the amount of data to delete
  • Make sure that the amount of deleted data is the same as the amount of backed up data
  • Try to launch an analysis for the same date, or an earlier date, an error message should appear: “No data to archive”

 

4. Check if everything is working fine

  • Check your booking list and verify that the oldest bookings have been removed
  • Check your calendars and verify that the oldest events have been removed
  • Create an event, book it, and make sure that everything is working fine

 

5. Restore your data

Now that we are sure that the deletion worked, let’s make sure that the data recovery works.

  • Go back to the archiving tool in Booking Activities > Settings > System tab
  • Click on “Restore data” on the line(s) of the backup file(s) you have created during step 3
  • Make sure that the amount of restored data is the same as the amount of deleted data (that you have noted at step 3.1)
  • Repeat step 4, but this time, check if the oldest events and bookings have been restored

 

6. Archive permanently

Now you can go ahead and archive your data for good.

  • Repeat step 3
  • Compare the amount of bookings and events to be archived with the amount given the first time you did it (noted at step 3.1). It must be the exact same amount. It means that the data have been correctly archived and restored
  • Repeat step 4 one last time

Done! You can deactivate Slim Maintenance Mode and keep on working with Booking Activities.

 

Something went wrong? Restore your database

If something went wrong at some point, simply restore your database thanks to the manual backups you have made during step 2.

  • Go to your server control panel
  • Go to phpMyAdmin and log in
  • Select your database
  • Go to the “Import” tab
  • Select your partial backup file
  • Click on “Go”
  • Check if everything is back to normal, else, import your complete backup file in the same way
Was this article helpful to you? Yes No

How can we help?