In Drupal 7. It was easy to move a Drupal module from installed path to another folder. Let us see how we can do the same in Drupal 8.
Assuming our modules are already installed in following path:
Source :
/var/www/yourproject/docroot/modules/custom/
This the new path you need to move the module in to:
Destination:
/var/www/yourproject/docroot/modules/custom/yourproject
Step1 : Move the module from source folder to destination folder.
Step2 : Clear the cache using drush.
Step3 : Clear the APC cache.
Thats all. After done all the above steps your site will run as usual and will refer the modules from the new path location.
Note: If you are seeing some custom block which created by custom modules still referring the old module path then try to restart your php.
To restart php:
sudo service php7.1-fpm restart