Take a backup of your site before executing the commands!
cd /var/discourse
./launcher enter app
rails c
Category.find_by_slug('STARTING-CATEGORY-SLUG').id
Category.find_by_slug('DESTINATION-CATEGORY-SLUG').id
exit
Change STARTING-CATEGORY-SLUG and DESTINATION-CATEGORY-SLUG with the slugs of the starting and destination categories. The results will be 2 IDs.
rake categories:move_topics[STARTING-CATEGORY-ID,DESTINATION-CATEGORY-ID]
for example
rake categories:move_topics[11,27]
./launcher enter app
rails c
c=Category.find(STARTING-CATEGORY-ID)
c.destroy