Skip to content
February 10, 2014 / kiranpatils

Package History V2 User Guide

Challenge:

Howdy, Folks? Have you ever had following questions/suggestions?

  • How nice it would be, If you can uninstall, Installed Sitecore Module/Package just by a click?
  • Is there any way to uninstall Sitecore Package automatically?

If you’ve ever came across  these questions and gave a quick search. Few of the following links might have appeared before you:

It means till this point of time. There is no any way using which you can uninstall Sitecore Package automatically. Yes, Manual way exists! But one of our teacher taught us “Whatever you can do manually, You can do it automatically!”. So, If you are looking for a way to uninstall Sitecore package/module just by a click (Do you remember “Uninstall” feature in windows?) then this module is for you!

Solution:

To make an idea a reality. I started exploring Sitecore Package and interestingly found that “package.zip” file for each module’s zip contains “project” file which is XML file and resides under installer folder. That file is the Core of this whole module!

After that rather than creating new module. I thought why NOT integrate it with my another module — Package History which is already live on MarketPlace. Have you tried it? Excerpt from module description “It will list all packages installed in your Sitecore Instance. It will also help you to answer questions related to packages installation like Who created package?, Who Installed it?, When it got installed?”

So, Integrating it in Package History sounded a good idea. As it will be a launch pad for Uninstall Package Module. So, this is how Package History V2 came in to this world!

Main Features

  • You can uninstall your installed package/module (Using original Package file)
  • Install/Try as many modules you would like to from Sitecore MarketPlace OR from another Sitecore enthusiast!
  • View package details in a tabular format

How to Download and Install?

  • If you would like to do it manually you can download zip package from MarketPlace [http://marketplace.sitecore.net/en/Modules/PackageHistory.aspx — PackageHistory_Version_2.0.0.0.zip]
  • It contains one folder named as “packageshistory” which contains .aspx page with name as PackageHistory.aspx.
  • You can copy this folder and paste it in your Webroot\Sitecore\admin folder. [Just a note : you can deploy it on any directory you wish to. But better to put under admin folder as it is secure folder, and as this page is using Single file model. It won’t restart/recycle your application.].
  • Access your page using  http://[HOSTNAME]/sitecore/admin/packageshistory/packagehistory.aspx
  • And click on “Uninstall (BETA)” Button from here
  • Which in turn calls “UninstallPackage.aspx” page
  • Would like to download source code? You can download via GITHUB Page — http://klpatil.github.io/PackageHistory/
  • That’s it! Enjoy! 🙂

Just a note : PackageHistory module has been coded using CodeFile model for ease of development and deployment. So, In case, If you would like to do any change directly after deployment, feel free to do it!

OR

You can download Sitecore Package from MarketPlace. Which will do everything for you!

Screen shots

  • This is how it looks like! (For a larger view, please click on the image)

Uninstall-Package-Final-Take-2

How it works?

This tool provides lists package details on following logic:

  1. Basically, Once you click on “Uninstall (BETA)” button it calls “UninstallPackage.aspx”
  2. Here you need to provide your PackageName, Using which you installed selected package. (In case, if your package doesn’t exist at Packages folder. Please do upload it manually). Don’t worry it does all validations! So, try it and learn it!
  3. After that when you click on “View Details” we extract package information and display it in a TABLE
  4. You can verify your ITEMS and FILES.
  5. When you are ready, and you click on “Uninstall” we iterate through all TABLE rows and fetch each item from respective database and RECYCLE it. (So, in case if something goes wrong, you can restore it back!)
  6. Please note, This tool will not delete files, due to ASP.NET recycle issue for sensitive files (Highlighted in RED). You’ve to delete them manually

Good to know/Caveats:

  1. Launched this module in BETA stage. Because uninstall package is sensitive stuff. And I’ve tested it from my end as much as I can. But no one is perfect in this world and same holds true for me! So, If you are going to use it on your production server. I would suggest you to take your database backup first!
  2. As stated earlier, Everything goes in to RecycleBin. So, In case if something goes wrong. Try to use this remedy!
  3. We are not touching any files at all, in this version due to ASP.NET automatic recycle behavior for sensitive files — Good read — http://kiranpatils.wordpress.com/2010/05/25/goo-to-know-on-asp-net-application-restarts/
  4. Haven’t done anything special for item versions
  5. If your original package has overwritten some item/files during installation. Then this functionality will not try to get its last version. But it will recycle it!
  6. Needless to say, Everything gets logged in to Sitecore log files (AUDIT entries for uninstall operation. So, you can check from log file that who uninstalled your module?)

I would like to hear from you

Found any bug? Got suggestion/feedback/comment, please do share via GitHub Page.

Happy Package Uninstalling! 🙂

Advertisements

28 Comments

Leave a Comment
  1. nileshmscit / Feb 11 2014 7:00 pm

    Really nice and practically helpful module! Very well explained..

    • kiranpatils / Feb 12 2014 3:51 pm

      Nilesh – Thank you!

  2. Davan Etelamaki / Feb 11 2014 7:43 pm

    I love the trace-ability that this module adds. It is a well built and well thought out module. For the installation of packages I usually use Sitecore Rocks to create an uninstall package though.

    • kiranpatils / Feb 12 2014 3:53 pm

      Davan – Thank you! Yeah. But this module is a good choice in following cases:
      A – On live server, where you haven’t configured Sitecore Rocks
      B – If you’ve already installed Package without creating anti-package using Sitecore Rocks!

      Your friend,
      Kiran

      • Davan Etelamaki / Feb 13 2014 7:56 pm

        Kiran,
        You have some great points. I am not meaning to put down the usefulness of this package.

        I see this as something quite useful, and am going to bring up the idea of us using it in our environment.

        Thank you,
        Davan Etelamaki

  3. jack / May 29 2014 10:42 pm

    HI ! I’m getting object reference not to set an instance of an object while view package information on uninstall page.

    • kiranpatils / Jun 2 2014 11:36 am

      Hello Jack,

      Sorry to hear that you are facing an error.

      To find out the reason, I need your help. Can you please give me following things:
      1. Log file, whenever you faced an issue.
      2. Package which you are trying to uninstall.

      Also, It would be great if you log your issue at : https://github.com/klpatil/PackageHistory/issues

      Thanks for trying uninstall module. And sharing your error, which will make this module better.

      Kiran

  4. jazotec / Sep 24 2014 9:45 pm

    Hi, I am using Sitecore 7.2. When I installed your module and accessed the /packageshistory/packagehistory.aspx page I do not see the “Uninstall BETA” column. The last column on the page is “Installed On”. Please advise.

  5. Mat / Oct 9 2014 2:41 pm

    Hey there Kiran,

    nice Module!
    Just installed it and had a little IQ test, as the page was not found by sitecore 😉

    In

    Access your page using http://%5BHOSTNAME%5D/sitecore/admin/packageshistory/packagehistory.aspx

    there is an “s” in “packageshistory”…

    Greetz
    Mat

    • kiranpatils / Oct 9 2014 6:55 pm

      Thanks Mat!

      You meant to say in foldername or aspx page name? Because as per my eyes both looks fine — Happy to be corrected!

      Kiran

  6. Pushpendra Singh / Dec 18 2014 2:05 pm

    Mat,
    brows the page from visual studio path (~/sitecore/admin/PackageHistory/PackageHistory.aspx).

    @Kiran, i am unable to unistall the install package giving right file name for unistall but giving error to me “Sorry, we are unable to extract package’s project information. It might happen when package is corrupted or unavilable. Please try again later.”

    Please suggest.
    Regards,
    Pushpendra Singh

    • kiranpatils / Dec 23 2014 11:47 pm

      Hey Pushpendra,

      Apologize for delay in reply. As was busy with lot of things. Yes, I’m aware of such issue. I did basic investigation and found that the way I do XML De-serialization needs to be changed – Currently I’m expecting one sort of input only. Just need to spend some time to incorporate and fix the same issue.

      Can you please create issue here? https://github.com/klpatil/PackageHistory/issues With all details, Package which you are trying to uninstall etc.?
      So, I can go ahead and test your package as well. Before final release.

      Apologize for inconvenience caused.

      Kiran

      • kiranpatils / Jan 5 2015 12:29 am

        Hey Pushpendra,

        Apologize for loong delay in reply. Got caught with lot of things. But great thing is The fix has been tested and deployed.

        Here are the details:

        Download FIX from here : https://github.com/klpatil/PackageHistory/blob/master/Release-Packages/V2.1/Package%20History-2.1.zip
        Issue Details : https://github.com/klpatil/PackageHistory/issues/1

        Happy New Year! And let me know if you are still facing issues.

        Best,
        Kiran

  7. sumit / Jan 22 2015 3:00 pm

    https://marketplace.sitecore.net/en/Modules/PackageHistory.aspx

    I installed the sitecore package v2 from here and i can see packagehistory folder inside webroot->admin folder. I installed this package using sitecore installation wizard.

    But everytime i am trying to access the related page using http://%5BHOSTNAME%5D/sitecore/admin/packageshistory/packagehistory.aspx needless to say that i am replacing the hostname with my instance name I am getting below error
    “The requested document was not found ”

    Is i am missing anything, please correct me and lets this package work for me. I dont wanna make antipackage everytime for every other installations.

    • kiranpatils / Jan 31 2015 1:11 pm

      Hello Sumit,

      Apologize for delay in reply — It looks like you are on the right path. You figured it out yourself? Or looking for some assistance on this?

      Let me know,
      Kiran

  8. Nick / Feb 5 2015 6:28 am

    Hi Kiran,

    I’ve installed the Package History-2.1.zip through sitecore installation wizard. after the installtion, when I tried to browse http:///sitecore/admin/PackageHistory/PackageHistory.aspx. I got an exception as below,

    Parser Error
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load type ‘Web.sitecore.admin.PackageHistory’.

    Source Error:

    Line 1:
    Line 3:

    Source File: /sitecore/admin/PackageHistory/PackageHistory.aspx Line: 1

    please let me know what i did wrong in the process or is there any work around?

    Regards
    Nick

    • kiranpatils / Feb 26 2015 12:14 am

      Strange — Is it still the case?

      • Andrew / Mar 31 2015 1:13 am

        Hi Kiran,

        I am also getting this error message with version 2.1. We installed 2.1 after installing version 2, overwriting any existing files. Any ideas?

        Thanks,
        Andrew

      • andrewkahai / Mar 31 2015 2:12 am

        We were able to correct this issue by fixing a couple of typos. AutoEventWireup=”True” needed a lowercase “true” and we changed CodeBehind=”PackageHistory.aspx.cs” to CodeFile=”PackageHistory.aspx.cs”

        We also made this change in the UninstallPackage.aspx file.

        I still seem to be getting the error that was originally addressed by this version: “Sorry, we are unable to extract package’s project information. It might happen when package is corrupted or unavailable. Please try again later.”

        This error occurs after providing the correct package zip file name and clicking the View Details button.

        Thanks, Andrew

      • kiranpatils / Apr 19 2015 6:35 pm

        Hello Andrew,

        Apologize for delay in reply.

        Thanks for the information. That might occur if your package deserialization fails. Can you please share your package? And check log files as well?

        Best,
        Kiran

    • F / Mar 12 2015 5:18 pm

      I have replaced the codebehind= by codefile= and removed the extra ‘s’ in the path and it worked (version 2.1). However when trying to uninstal sitecore powershell extensions 2.8 all I see in the list in step 2 is single entry:
      Database Item Path/File Path
      master /sitecore/system/Modules/PowerShell/{D

    • Alex / Apr 16 2015 3:52 pm

      HI, to people who get “Could not load type” error, changing “CodeBehind” to “CodeFile” in PackageHistory.aspx worked for me.

      • kiranpatils / Apr 19 2015 6:33 pm

        Alex,

        Thanks — Folks, please give it a try! And it should work for you! Will update package sometime.

        Thanks,
        Kiran

  9. Nickunj Ajit Sanghadia / Feb 20 2015 6:23 am

    This module list down all the Packages I have installed using update installation wizard but not able to uninstall them as they don’t fall under package folder. any solution to uninstall packages install via update installation wizard?

    Cheers
    Nick

    • kiranpatils / Feb 26 2015 12:13 am

      Good point. Unfortunately — Currently it’s not supported? Would you mind adding it as a request in GitHub? Or would like to take it?

      Kiran

  10. Rusty / Oct 22 2015 11:37 pm

    Is this Compatible with 7.5?

    • kiranpatils / Nov 10 2015 11:44 pm

      Haven’t tested — But theoretically should work – let me know if it doesn’t

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: