Update upgrade.rst: Added docs for the new function clean()

Added docs for the new function: clean()

This change has costed me one day to figure out. Hope this piece of docs would help others when upgrading.