Its quite easy to move magento site from subdomain to main domain (and vice-versa). You can do it by two different ways and it is more easy when you go with the below steps.
Step 1:
- Go to Magento Admin Page –> System –> Configurations –> Web –> Unsecure URL & Secure URL. Change both the secure URL and unsecure URL to the domain that you are going to be moved to. Be sure to include the “/” at the end of the domain name.
- Go to your File Manager and click “Select All”. Click “Move” and key in “/public_html” to move it to the main domain’s directory.
- You need to clear the caches at “var/cache” and “var/session” after you have moved all files over.
Step 2:
- Go to phpMyAdmin. Find and and choose your database on which your magento site is running. Scroll down and look for core_config_data table and click “Browse”.
- Find the path “web/unsecure/base_url” and “web/secure/base_url”.
- Click on the "Edit" of both of the path above and edit the URLs accordingly. Click “Go” after the URLs have been edited.
- Once the URLs has been edited, you need to clear the caches at “var/cache” and “var/session”
Note:- It is always good to have backup your files and databases before doing these exercises.
SOCIALIZE IT →