Changed the queries to the new database settings