Once the cleanup is over, start the API Manager pointing to the cleaned-up database dump and test throughly for any issues. You can also schedule a cleanup task that will be automatically run after a given period of time. Here's an example: