Did you ever experienced hard times trying to get your hand crafted Wordpress website transferred from your local test environment to the destination server? Did you spend countless hours trying to make things work? If you can answer yes to these questions then this article is for you. I’ll explain in plain English how to make a smooth transition from you localhost to the destination server.
Before we begin, I need to make some assumptions:
- You have your website working perfectly on your local machine.
- Local environment is either a PC or Mac on which you run a web server with PHP and a MySQL database and you have access to phpMyAdmin.
- Destination server runs Apache or IIS, you have FTP details, access to phpMyAdmin, database server name, database name, database user name & password.
- Other configurations may work as well.
- It doesn’t matter which version of Wordpress you are using.
Also, a quick “executive summary” of all the steps below:
- Export your local Wordpress database to a text file.
- Search and replace http://localhost/yoursite with http://www.yoursite.com
- Create a database on your destination server and import your database.
- Copy all files from your local machine to destination server and amend wp-config.php file with new database details.
- If necessary change file and folders permissions so Wordpress will be able to use them.
Step 1 – Export Local Database To Text File
Open up your browser and access phpMyAdmin and select your website database from the drop down box on the left. This may look like this:
Go to Export section (click on the Export tab at the top). Depend on your version of the phpMyAdmin this section may look bit different but the functionality will be the same.
Click ‘Select All’ in the Export form. All tables should be selected now. Leave other options as they are. Navigate to the bottom and tick ‘Save as file’ checkbox. Click ‘Go’.
File save dialog will appear. Click OK and save that SQL file on your computer. Step 1 completed. Get yourself a coffee.
Step 2 – Search & Replace
Now, we have to change your database export file and find & replace all URLs that contain http://localhost/yoursite with http://www.yoursite.com
I’m using Dreamweaver but you can use any text editor to do the same.
We have to change another line as well. Find line
C:\\Program Files\\xampp\\htdocs\\yoursite/wp-content/uploads and strip it down to /wp-content/uploads and finally save your SQL file.
Step 3 – Import Information Into Destination Server Database
On your destination server you have to create database for your WP installation. It may look like this screen below (assuming you’ll be using phpMyAdmin) However in most cases you’ll have to log onto your server administration panel and create database, user and password from there. It varies from provider to provider so please refer to your hosting provider help section.
Now as you have your database created you should populate it with your data. Click on the Import tab at the top of the page. Click on Browse in the ‘File to import’ section and select your amended SQL file. Click Go to proceed.
If everything went well you should see table names on the left hand side and a message saying something similar to this: ‘Import has been successfully finished, 162 queries executed.’ You’re done and deserve another coffee.
Step 4 – Upload Wordpress Files
In this step you should use your favourite FTP client to upload all files to your destination server. If you created a brand new website than you can upload everything including index.php file. If you upgrading an existing website then you have to make sure that it will work until you launch your WP website. DON’T DELETE ANY FILES that belongs to your existing website. Make sure your Wordpress website works first, then you’re safe to delete the old files.
To make your website work you should update wp-config.php file with your database details: database name, database server address, database user and password. Once done, you should be able to see your new website at http://www.yoursite.com/
Now, you have to test if you can login to the administration panel. So type in http://www.yoursite.com/wp-admin/ to find out. If you can see WP admin login screen you’re half way there. Type in your login details and login. If you’re successfull you should see WP Dashboard.
That’s it. You’re done.
Step 5 – Fine Tuning your Wordpress website
Few other thing you should take care of:
- Make sure that you can upload any new images or documents. If you can’t it means that you have to change files/folders permissions and give Wordpress read/write right for necessary folders.
- Check if your permalink structure works. Amend if necessary.
- Make sure you’re running the latest version of Wordpress and upgrade automatically to the newest one where possible.
- Check if you have installed latest versions of any plugins that you’re using. Be careful though! Some plugins require PHP5 to work properly or require additional libraries to be enabled. Check this prior to any upgrades.










[...] [...]
[...] the original post: How To Move Wordpress Website From Localhost To The Destination Server | Revolution Media Comments0 Leave a Reply Click here to cancel [...]
This was EXTREMELY helpful, thank you. I haven’t come across another article so detailed and yet so simple.
Brilliant. Thank you so much, you have just saved my life!!
I was really panicking because my client wants to check this live tomorrow. Spent AGES trying to work it out, really appreciate your post!
Damien
Thanks, but which file do i change the root of the server from http://www.localhost/ to point to http://www.plexusbusiness.com i managed to get it on the server but whenever i logged into the admin area it reverted me back to localhost, ive checked the config file and the setting file but the local host url is’nt in there
Thank you very much. You’ve save my time looking on creating a new website and redo everything from scratch all over again.
Thanks for sharing good information, i learn how to move wordpress here.
Keep posting.
David
I have in my localhost installation a .htaccess file is present.
in side this file there are some times that old base directory appears
Qe need to change this???
tks
Thanks for the info, but I can’t import to the server and the message like this
Error
SQL query:
– phpMyAdmin SQL Dump
– version 2.10.3
– http://www.phpmyadmin.net
–
– Host: localhost
– Generation Time: Oct 13, 2009 at 09:58 PM
– Server version: 5.0.51
– PHP Version: 5.2.6
SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘– phpMyAdmin SQL Dump
– version 2.10.3
– http://www.phpmyadmin.net
–
– ‘ at line 1
Why ? and how to solve this ?
Thanks for your post, very clear instructions which actually work!
One error i noticed. At the end of step 2 you said:
“We have to change another line as well. Find line C:\\Program Files\\xampp\\htdocs\\yoursite/wp-content/uploads and strip it down to /wp-content/uploads and finally save your SQL file.”
Did that but the upload function didn’t work.
I exported another SQL database from my website to see what the code in that said. It was:
‘/home/coddinfo/public_html/MIA/wp-content/uploads’
so i edited the SQL database in PHPmyAdmin from:
‘/wp-content/uploads’
to:
‘/home/coddinfo/public_html/MedInAde/wp-content/uploads’
Upload now works.
Thought that might be helpful to know if someone is experiencing upload issues. Thanks again for the post, really helpful.