How To Transfer WordPress Site From Localhost To Server?
July 27th, 2016 | by Ravi Chahar || 8 Comments |
Most of you may have an offline website running on the local host. That localhost may be created by Xampp for windows and MAMP for Mac users. Do you know how to migrate WordPress site from localhost to server? Have you ever thought that you should move your website on a live server so that the whole world can access the information?
In this post, I am going to tell you how to move website from localhost to server. It doesn’t matter whether you are a Windows user or the Mac user. The thing is the localhost has the same features in both.
How To Migrate WordPress Site From Localhost To Server?
There are many things to do for the migration of the website. You all know that the database and the directory files are the things to transfer from the localhost to the live server.
Step 1:- First of all, you have to create a new database using the cPanel of your web hosting account. It’s because you have to import the database on this new database.
Step 2:- Visit your localhost phpMyAdmin by typing “localhost/phpmyadmin.” in the browser. Let me tell you that the phpMyAdmin is the same you see in your cPanel. There is nothing different on the localhost. You have to export the database.
In true words, you have to backup the database of your website from the localhost phpMyAdmin. Download it on your hard drive.
Step 3:- Upload that database using the “import” option in the new database you have created in the first step using the phpMyAdmin from the cPanel of your web hosting account.
Step 4:- Now is the time to upload all the files on the live server or we say it the web hosting. You can use your FTP account from the Filezilla. For which, you should know how to connect Filezilla to FTP server.
If you don’t want to use Filezilla then you can directly upload the files in the cPanel. Let me remind you that it would be hard to upload directly on the server without using any tool like Filezilla. If the size of your website is smaller then it would be fine otherwise, the upload may get interrupted in between.
Step 5:- To upload the files, copy all the files from the Xampp folder or any software you are using. Just go to the Xampp folder in the drive where you have installed in on your computer.
After that find the WordPress folder or the folder in which you have stored the data of your website. If you can’t find the files then the best way to use the Filezilla. It is because you can find the files easily and the upload would be easy.
In most of the cases, people don’t create any folder, so just open the “htdocs” folder where you can find all the files of your local website. If you find the WordPress folder then open it and copy all the files and folders.
Step 6:- Login to your cPanel and open the “file manager” from the files section. Paste all the files and folders you have copied in the previous step here in the root directory.
Step 7:- Change the URL of the site. It can be done from the database using the phpMyAdmin from your cPanel.
Step 8:- You may be getting the database connection error. It’s because the credentials of the database are not same as on the localhost. To remove that error, you have edit the “wp.config.php” file from the cPanel. You would find the file in all the files you have just copied.
Right click on that file and choose to edit the code. You would find the database name, host name and similar lines. You have to fill those credentials according to the database you have created in the first step. You can’t transfer WordPress site from localhost to server until you fill all the credentials correctly.
Step 9:- Set the SEO friendly permalinks from the WordPress dashboard.
Step 10:- Are you getting the broken image links on your whole website? It is because you haven’t change the path yet. You should change the path by adding two lines of the code in the SQL editor.
Step 11:- Many bloggers forget to set the DNS server. You have to set the DNS server for your domain name. For every web hosting company there is a different DNS server. You can check the server from your web hosting website.
Step 12:- The migration may take 24 hours to show your website online. It’s because the DNS server takes time.
You have successfully migrated your website from the localhost to the live server.
Do You know How To Move Website From Localhost To Server?
I have explained the best possible way to transfer WordPress site from localhost to server. Make sure that you find the right folder where you have stored the data of your website in XAMPP or MAMP. If you copied the wrong files then it won’t be possible to make your site alive.
To move website from localhost to server it’s important to create and import the database of your offline website is the necessary step. Connect the database by filling the credentials in the “wp-config.php” file.
If you still face any problem while following the procedure then you can ask me anything about it. I will try my best to solve your problems.