I am also interested in the answer to this!
We are running 3.2 and and have been successfully using Piers Harding's tool for some time now (https://github.com/piersharding/moodle-tool_uploadcoursecategory) but am worried that development will cease soon! I notice that it hasn't been updated since 2016.