Fetching data before emptying db