I took some time to do some analysis on our end. so i tried different ways
i compared the Octopus deployment Purge and copy file timing (which is appox 7 to 8 mins now) with manual copy to a path on the production server as you suggest previously. surprisingly the manual copy ( id do it through a powershell script to be accurate on time) it took ~40sec average to copy the files locally on the same server.
i tried the copy process by zipping and unzipping the release folder on to a different path locally, this also was faster as compared the octopus deployment copy file timing.
I performed this test against our qa and 2 production servers for 4 different release.
deploymenttiming.xlsx (9.2 KB)
This number still surprises me why octopus is taking so much to just copy files locally, does it use any special zipping/unzipping. I also saw the deployment logs which it writes , does this have any impact on the copy process.
I do not see why we wont perform the purge and copy process through a power shell template and give it a try and see if it helps. Please suggest