Added function to extract database.