Most web hosting services for small online business are virtual hosting with support for multiple domains. In one hosting account, you host one domain as the primary domain, and other domains as add-on domains. The add-on domains are actually sub-domains of the primary domain on the physical structure, but they are mapped and ported to the top level domains, thus there is no difference between primary domain and add-on domains for internet users on the web.
What if you want to change the primary domain? For example, if you sold your domain name which happened to be the primary domain in the account, you need to pick up an add-on domain to become the new primary domain. You can contact the technical support of your hosting service to do this for you. For instance, in Bluehost, this can be done via phone or live chat. The technical staff can set another domain as primary through a process called an account "Rename." The said the rename Process normally takes from 20 minutes to 5 hours, depending on the size of the account. It actually took only 10 minutes for my primary domain changed.
There are some rules for this process. The domain you are changing to must be associated with the account first. The current main domain can never become the main domain again. The current account's username, password, files, databases and e-mails will remain unchanged. The new primary domain will point to the public_html directory itself, the same way the main domain does currently.
After the process, all add-on domains become sub-domains of the new primary domain. There is no change for the public_html folder but the new domain points to it now. There is no account login change or MySQL database change, thus all websites, either static or dynamic (with MySQL database), work the same as before. As always, backup everything before making any changes.