Added export database functionality