fixed errors in database dumping and ensured permissions preserving on
local file copy