powerplatform-vscode icon indicating copy to clipboard operation
powerplatform-vscode copied to clipboard

pac paportal download overwrite issue

Open IsolatedStorage opened this issue 3 years ago • 5 comments

pac paportal download --path C:\dev\paportal -id 86bfb5ee-c2f2-ec11-bb3c-00224811280e -o

Using the overwrite option does not remove items that have been deleted from the environment. For example, if an original download of the portal configuration includes a Page Template but that Page Template record is deleted from the environment within D365, the subsequent download does not remove the deleted Page Template from the manifest.

IsolatedStorage avatar Aug 15 '22 12:08 IsolatedStorage

Hey @IsolatedStorage

  1. The correct syntax for overwrite is -o true
  2. When we use overwrite option the deleted data from the environment will be deleted from the file system but the manifest entries will not be deleted (we need this to track the deleted entry).

Please confirm if the observed behaviour is same as # 2.

ashishchoudhary001 avatar Aug 16 '22 09:08 ashishchoudhary001

Hi Ashish,

For #2, my findings are that the YAML source file for the deleted entry remains on the file system. In my scenario I had a Page Template that was deleted from D365 but the .pagetemplate.yaml file was not deleted from my page-templates directory.

Regards

Alistair

IsolatedStorage avatar Aug 16 '22 23:08 IsolatedStorage

The root cause of this is that source control repositories are inherently additive. If you remove a component that was previously included in source control and then re-add the updated code base (with a component removed) it will show additions and changes only. The previous component will remain in source until it is "removed". Through scripting you can perform a diff and then remove components.

craig-lund avatar Aug 17 '22 00:08 craig-lund

After the -o true flag is provided while downloading the paportal command will delete all records in download path and then download records which are present in the org. As a result, records which were there in the file system but no more exists in the org are also deleted. This delete operation is also recorded in the manifest.yml file in order to relay these deletes to other orgs when the upload action is executed. Hope that clarifies the working. @IsolatedStorage is the paportal not behaving as described above? Or you are looking for some other functionality?

ameyaapte1 avatar Aug 22 '22 14:08 ameyaapte1

@ameyaapte1 thank you for your response. My findings have been that paportal is not deleting files from the system once they have been deleted from the org and the overwrite flag is used.

IsolatedStorage avatar Aug 23 '22 23:08 IsolatedStorage

@IsolatedStorage to check on what you mentioned earlier, I created a new webpage via Studio called "will_be_deleted" and then did a pac download and checked the files into git. After deleting the webpage from Studio, I again did a paportal download -o and found the below diff (where the webpages were indeed deleted.) image

Let us know the repo steps if you still face this issue. Closing the thread for now.

MrRishabhJain avatar Oct 22 '22 09:10 MrRishabhJain