Use transaction and rollback simply
Delete outdated entries/categories
Add fields and indexes