Forum Discussion
Testing an updated web part, on a live SharePoint site, without affecting the existing version
- Nov 28, 2017
The Site collection app catalog should help when it becomes available, but until then you can deploy a Test version of the App to the app catalog and your cdn and deploy the test version to your test site.
in package-solution.json change the solution name to test-yourappname and the id to a new guid and the zipped package name to solution/test-yourappname. This will make the app unique.
in write-manifests.json change the cdnbasepath to a new folder where you will deploy you deploy your test code so that it does not interfere with the production code.
for each of your webparts in the webpart.manifest.json change the Id to a new guid. You cant have two webparts in a tenat with the same id.
then gulp clean; gulp bundle --ship, gulp package-solution --ship. This will create a new sppkg file for your test app , with a different name (test-yourappname) that references the different cdn location you specified in write-manifests.json.
note: for each of these files, I keep a .production and a .test version in my project so I can just copy the contents from either file when I am ready to deploy. It would be awesome if we could have gulp do that for us!
then upload the test sppkg to your app catalog (solution/test-yourappname.sppkj) and deploy the files in temp deploy to the folder you specified in write-manifests.json to your cdn. You can then deploy your test app to your test site without interfering with production. You can even have the two versions running side-by-side in the same site collection,
Its a bit of work, but it has been working consistently for me for months now.
The Site collection app catalog should help when it becomes available, but until then you can deploy a Test version of the App to the app catalog and your cdn and deploy the test version to your test site.
in package-solution.json change the solution name to test-yourappname and the id to a new guid and the zipped package name to solution/test-yourappname. This will make the app unique.
in write-manifests.json change the cdnbasepath to a new folder where you will deploy you deploy your test code so that it does not interfere with the production code.
for each of your webparts in the webpart.manifest.json change the Id to a new guid. You cant have two webparts in a tenat with the same id.
then gulp clean; gulp bundle --ship, gulp package-solution --ship. This will create a new sppkg file for your test app , with a different name (test-yourappname) that references the different cdn location you specified in write-manifests.json.
note: for each of these files, I keep a .production and a .test version in my project so I can just copy the contents from either file when I am ready to deploy. It would be awesome if we could have gulp do that for us!
then upload the test sppkg to your app catalog (solution/test-yourappname.sppkj) and deploy the files in temp deploy to the folder you specified in write-manifests.json to your cdn. You can then deploy your test app to your test site without interfering with production. You can even have the two versions running side-by-side in the same site collection,
Its a bit of work, but it has been working consistently for me for months now.
Hi Russell Gove
Thanks, I did what you suggested and it worked perfectly. Between Andrew Koltyakov and yourself I have two great solutions.
- Thao Pham-AaltonenSep 24, 2018Brass Contributor
Thanks to all this previous information, it led me to find that the site collection app catalog is now available and so I was able to set up an app catalog for a test site collection and an app catalog for the live production site so I could keep the updated web part in the separate site collection and have testers test without impacting production (we still have to duplicate some of the list data that's causing bugs in our web parts but ShareGate can help in some cases). In case this helps anyone else: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/site-collection-app-catalog