Upgrade copyTree

To support target file system and include testing.