Move categories to database.