There is also one other thing you can do and that is to use, what I call a "Grease & Oil Change" maintenance program called Onyx. This is a FREE program that is a multifunction utility that you can use to verify the structure of the system files, to run miscellaneous maintenance and cleaning tasks, to configure parameters in the Finder, Dock, Safari, and some of Apple's applications, to delete caches, to remove certain problematic folders and files, to rebuild various databases and indexes, and more. I always use it prior and post system OS updates and about once a month. In your case I would use pre upgrading to a higher OS and then post that upgrade.
This program is available here: Titanium Software - Onyx. ONLY DOWNLOAD THE VERSION FOR THE RELEVANT macOS !!!!
NOTE: This is NOT the CleanMyMac program which quite rightly has had a lot of bad press.
