I wanted to gain an understanding of utilizing the Anti-Package feature of Sitecore Rocks not only the creation process for use as a backup, but also I wanted to verify what happened when I restored with the anti-package in the event just to verify what was taking place.
I started by taking a look at Trevor Campbell’s post on the creation of Anti-Packages here: https://www.sitecore.net/nl-be/learn/blogs/technical-blogs/trevor-campbell/posts/2013/02/28-days-of-sitecore-rocks-package-management-part-1.aspx. Since, the creation process is pretty well documented, that will not be covered here.
I created a package using Sitecore Rocks and named it MyPackage.
The following items were added:
The following files were added:
The following files were created in a folder I specified:
Now, that I have my package created I create the anti-package using the process Trevor described in his post. Take a look at the information at what the creation of the Anti-Package does:
I added some basic content to the Sample Item using Sitecore Rocks and saved the item as seen below:
Now, when I install the Anti-Package the Sample Item gets reverted back to its original state as seen below:
So, I couldn’t help but ponder the question, what is the point of an anti-package when you can make a normal package and re-install it and it should do the same thing right? As a matter of fact, if I look into the .zip files for my MyPackage.zip and MyPackage.anti.zip they are the exact same.
I believe the benefit lies with using the Anti-Package as a backup strategy particularly in module development for Sitecore. I think it’s a great habit to get into when working on a module that is continually being updated to create Anti-Packages as you are putting out updates. The benefit of the anti package is the naming convention (anti.zip) and in Sitecore Rocks the Anti-Package will have its own area for designated Anti-Packages, which could be seen as backups that can be restored at any time. This simple strategy allows you to be able to rollback to most recent release of your module. For example Excel Transfer Utility Version 1.0, when you are putting together the updated package for 1.0.1, which may contain bug fixes.
Overall, Anti-Packages are beneficial in my opinion. Not only with Sitecore module development, but as a best practice to have a backup of any important packages you may need to revert back to over time. Happy coding!