Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore Cleanup Agent and Database Cleanup

In Sitecore Control Panel there is a command to perform Database Cleanup. Does this cleanup History, PublishQueue and EventQueue tables in both master and web database?

There are also cleanup tasks in the web.config for the above tables. If they are only enabled on the CMS server, do they perform cleanup in both master and web databases?

Thanks

like image 585
Gabbar Avatar asked Feb 01 '13 20:02

Gabbar


1 Answers

I assume you are referring to the "Clean Databases" option on the Control Panel/Databaeses screen.

  • The command prompts you to select which database (web, master, core) you wish to clean up.
  • I looked at the implementation of the CleanupDatabase method in the class Sitecore.Data.DataProviders.Sql.SqlDataProvider using DotPeek, and it does the following tasks:

    1. Removes items that have parents, but the parents are not in the item tree.
    2. Removes invalid language data.
    3. Removes fields for non existing items.
    4. Removes orphaned items.
    5. Removes unused blob records.
    6. Removes fields from orphaned items removed in step 4.
    7. Rebuilds the Descendants table (which stores parent/child relationships).
    8. Clears all caches.
  • I have confirmed that this task does not clear the History, or PublishQueue tables. My EventQueue table was empty, so I could not test this.

  • The Web.config clean-up tasks iterate through all the <databases<>databases> nodes, so they should act on the Web database even from the CMS environment. This can quickly be proven out by examining one of these tables before and after this job has run.

Note: This analysis is based on reflecting Sitecore 6.6.0, version 121203.

like image 77
Dan Solovay Avatar answered Sep 17 '22 10:09

Dan Solovay