Exporting modules manually

I did a fresh install and then I grabbed the modules folder from an older install and moved it to new install. I did the same for the custom folder. My custom modules would not show up in the UI. How can I get these custom modules to add there fields to db and become available for use if I add the folder manually? I eventually got lucky and got them to show. I went to the other installation and did an export and then did the import. Things broke and I replaced some modules and hocus pocus everything worked. If I import my modules folders manually using something like scp how can I get them to register witht he databse etc…?