Added mysql database cleanup and archiving for the production system