There is no need to "upload" the /cache and /gallery directories, as you would already have them on your current functional install.
The install zip archive includes these for the purpose of a doing a new/initial installation.
Link to the upgrade documentation you're referring to:https://www.ubbcentral.com/doc_upgrade7.php
* The "Upload these" section are the functional program script directories.
* The "Do not upload these" section are your own forum custom configuration directories.
* Everything else not mentioned are either your forum's /cache or /upload (attachments/gallery) directories.