After you have spent much time building a store by putting up your products in it, and configured the currency rate on your localhost, you are probably happy with the results. But now you want this store to get international popularity, and you want customers from all over the world. To achieve this, you have to upload your store on a live production server so that everyone can reach out to you.
In this tutorial, I am going to do my best to help you transfer your store successfully to the live production server from your PC where no one really sees it except you 😉
Things to Check Before Beginning!
First of all, you have to purchase a domain. We will assume that you own one, but if not, then purchase it from any domain provider.
Getting back to where we were. To upload a Magento store on a live server, here are steps to follow.
Step 1: Export Your Database From Localhost
First of all, login to the phpMyAdmin account on your localhost on PC using any localhost software. It can be XAMPP, WAMP or any other one on which you work. Open up the store’s database. Now at the top of the menu, you will see the option of Export. Hit that option and then hit the Go button, the localhost software will download the database files of your store in the form of .sql extension. Save it as it as or in .zip form. The below picture will make you more clear.
Step 2: Make Your Magento Files in Zip Format
At this step, all you have to do is to zip all the Magento files that you will upload to the live server in a short while. Just go to htdocs folder( if XAMPP) or www folder ( if WAMP) and then go to Magento folder and then compress all the files in the zip folder.
Step 3: Upload Your Magento Files From Localhost to Your Web Server
Next, you have to upload your database to the domain through the cPanel. First of all, login to the cPanel of your live server and then go to phpMyAdmin. Create a new database there.
Here are some important things that you have to note down which includes the database name, username, and password. Just click on the new button and create the database.
Step 4: Import Database
Now that you have created the database successfully, what you have to do is to import that database which was downloaded from the localhost on your PC into this new database that you have just created.
To do so, select the database that you have created and trace the Import link on the top of the menu. Select it and then at the section Files to Import click on the button Choose File and now choose the file that you dump from your PC. Make sure that the format should be .sql.
After that, click on the Go button. This will take a few moments to import the database.
Step 5: Upload Your Magento Files
Now, if you want to make a subfolder on your new domain, you can make it. Otherwise, you can work with the normal directory as well. Upload the zip file of the Magento file that you had made in step 3. After you have uploaded it, extract that file there.
Step 6: Change local.xml File for Access Magento System to Your New Database
After you have uploaded the Magento file’s zip folder and extracted it, you now have to make some changes in local.xml file with your directory.
To locate this file go to app/etc/local.xml and then select the local.xml file. Now in your local.xml file you have to change the information that is related to your new database that you have created on your domain. The information includes the name, username and the password that you set while importing the database on your new domain. You now have to locate in the file where this information can be fitted in. You will find that the connection tag has to be replaced with the new one. It will be something like this.
Step 7: Identify Your New Domain Name for Magento System
Now you have to save the changes. If you are editing on the browser, then you have to click the save button in the top right corner of the browser. But if you choose to download and edit the file, it’s now time that you have to upload it again within the right directory.
Go to your Magento database and search Table Core_Config_Data and replace your localhost URL to your Domain name in “web/unsecure/base_url” , “web/secure/base_url”.
Step 8: Clear Cache
Now you have to clear the cache that contains the data from your localhost so that it can have new data related to your newly uploaded Magento store.
To clear up the cache what you have to do is just go to /var/cache and delete all the files and content from there. You can remove by selecting all files and then select the red cross button with label Delete from the menu, and this will delete all the files. You can also delete them one by one by selecting the file and then right-click it and then select delete.
Step 9: Access Your Store
Now if you have done all the above steps successfully, your Magento store is now successfully uploaded on your domain from the localhost. Now go to your browser and then enter your domain name or the public IP of your domain and then hit enter. You will see the frontend of your store if you have done all the above steps as they are mentioned in this article. It will look the same as it looked on your localhost.
Everything is done! This article helps you through uploading your site or Magento store from localhost to any live production server in a very easy manner. All you have to care about is to maintain the backup of everything (database and Magento store files). Now if you want to edit anything, you can do it in the browser or by downloading it. Hope this walkthrough is a good solution for uploading your store.
If you have followed the above steps, it will be very easy to do the job done but if you still have any questions, feel free to ask me or if you want to give your feedback, comment it in the comments section below. Hope this article served you well. 🙂
This is a gues blog post by Fayyaz Khattak – a Magento Community Manager at Cloudways – a Magento Hosting platform.