
So you have everything ready for launch and your site is sitting on your local computer. You're ready to move WordPress to the "real" server and start publishing. Here's a step-by-step tutorial on how to export and import your data base, and get WordPress running on the new server. Prepare for the moveMake sure you have your website working perfectly on your local machine. Your destination server needs Apache or IIS, Have these access details handy: Be sure you have your URL chosen and registered and pointed at your production server.
Database Information on destination server:
Checklist of steps to complete
Step 1: Change the URL![]() The easy way to do this is to go to Settings > General and change the Wordpress address (URL) an the Site address (URL) to http://yourwebsite.com Or if it'sgoing to be in a subdirectory - http://yourwebsite.com/subdirectory Save the changes. You could also export the data base, then use a text editor to do a global search and replace for the URL. THIS WILL GIVE YOU AN ERROR MESSAGE - but you can ignore it for now. ![]() After you change the URL, if you try to visit your localhost/wordpress site, You may see only text or nothing, this is normal, since you have changed the URL, wordpress is looking for everything on the server, which is not ready yet. Step 2: Go to phpMyAdmin![]() Depending on what local version you are using, find phpMyAdmin and open it. Here we're using XAMPP and you can get to the XAMPP menu by typing http://localhost in your browser address bar. Or you can get there from the XAMPP control panel by clicking Admin next to MySql. ![]() In your phpMyAdmin control panel choose the correct database from your list of databases on the left. You created this data base and named it when you first installed WordPress in XAMPP. Double click the name of the data base you want. Step 3: Export the database![]()
![]()
![]()
![]()
![]() Be sure to save it in a folder where you can easily find it. You will be importing this file to the server using phpMyAdmin on the server. Step 4: Create a database on your new server![]() How you do this depends on what type of server control panel you have. You will need to check with your web host if you are not certain how to do this. Once you have created it, make sure you write down the data base host, data base name and the data base username and password . You will need them later. Open phpMyAdmin on the destination server. Your server control panel will have links to a way to create the data base, as well as a way to manage the database once it's created. Step 5: Import the database![]()
![]()
![]()
Step 6: Upload the WordPress Files
![]() You should already have created the account on the server, and you have the login details from your hosting company Your FTP server (usually your domain name), your username and password. The image above shows what the FTP connection screen looks like in Filezilla. If your domain name has not been propagated yet, you can also use the server IP address in the host field. I like to keep notes about my control panel access in the comments so I can find them easily. Upload the entire contents of your local WordPress Installation from your local machine to the remote site. ![]() In most cases you will want to upload everything, pictures, files and all directories to the /public_html folder on your server. Some hosting companies use /www as the place to put your web files. If you want to put it into it's own directory you can read more about it in the codex. You will find the files to upload inside a folder in \xampp\htdocs\wordpress\ on your local computer. I named the folder wordpress, your folder name is whatever you created when you installed the site. Step 7: Create the connection to your database![]() Open your wp-config.php file, located in the main WordPress directory in the new location, in a text editor and look for the section with the database information. You will see whatever you had set for the data base on your local server. Change this to the data base information for your new server (hopefully you recorded it when you created the data base. It should look something like this. ![]() Different hosting companies use different naming conventions for usernames and passwords. Check with your hosting company if you need to. Some hosting companies will use localhost for the MySQL hostname, and you won't need to change it. Some, like GoDaddy, use different servers for the data base and you won't be able to use localhost. You will need to check with your hosting company for the correct information. You should now see the site in it's new location! |

With Admincredible you can update and manage all your Joomla sites. If you have 5 or 500 sites, Admincredible will make your life easier! Visit Admincredible.com.
All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:
Open Source Training is not affiliated with or endorsed by the Joomla, WordPress or Drupal projects.
All product names and trademarks are the property of their respective owners.
Copyright 2013 Open Source Training, LLC. All rights reserved.
Comments
Sorry for the inconvenience, but if you're a student at OSTraining, could you copy and paste this into the support forum so one of our support techs can look into it for you? All you have to do is log in at www.ostraining.com and click on Support Forum in the main menu.
Please see the support FAQ for more information:
www.ostraining.com/.../
Kind regards,
Nick
Best wishes,
Andrius.
You're welcome! Yes, it's possible and your wp-config.php file just needs to be configured in the same way. For xampp, try the user "root" and no password.
Kind regards,
Nick
There's a lot more great tutorials available inside to members if you're interested in learning more:
www.ostraining.com/online
Kind regards,
Nick
Wouldn't it be a lot more simplier, and with far less steps just to use the BackupBuddy Plugin ?
Cheers,
"Error establishing a database connection"
- on both remote AND local version of my site. Freaking out :(
It's likely that your database settings are incorrect. Make sure that you've spelled and correctly capitalized everything as well as prefixed the account prefix if necessary (e.g. cpanelusername_databasename)
Kind regards,
Nick
Awesome article and i wish you the best of luck, you saved my dag and a lots lots of time.
Kind Regards
Johan
codex.wordpress.org/.../
I have spent approximately 2 hours trying to retrieve my website due to the problems I encountered at step 1 as the sql zip file encountered errors once I tried to upload to the myphpadmin area in the control panel.
I did all the step successfully.
But on website its not turning up.
Please guide.
Thanks,
I managed to upload my local WP website to its final location, see for yourself >> Le Coin des Bois.
It was interesting to note that my DB name had to be in uppercase.
Worthy Info
Great Tutorial
Thanks in adv.
question: i went through this process but due to weird sql set up on the server, had to fresh install wp on server. Now i want to go back and export an xml of my site files, but as you know localhost/wordp ress won't bring it up. How can i get back into my local site??? Help! Thanks
my host don't have "MyPhpAdmin" on his server, so i import this file, - but where it should go?
You saved my life! :)
It was an amazing tut!
your article is very useful today i successfully update from xampp to online. now i want to do edit some pages offline in xampp but after edit the wp-config.php it dos't work in login so please help me how can i edit online or offline . i shall be very thankful to you.
- Find the file "functions.php" inside your theme's folder, on localhost (the theme that is currently in use). It should be in somewhere like this: \www\wp-content\themes\YOURTHEME\functions.php
- Open this file on notepad or any software where you can edit it, and add the following lines, right after the initial "
- Save the file, turn off your WAMP server and back on, then try to access (the site and the admin page, on localhost). It should work now.
REMEMBER: After you succeed accessing your site, go back on the file and remove the lines you added. If you created the functions.php file, delete it. It will still work, but leaving those lines there might not be good, trust me. Even after you remove them, you'll still have access.
Hope this helped you guys, I actually spent a really long time to reach that.
HELP