Move A WordPress Site From Localhost To Production |
| September 1, 2011 |
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! |
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 © 2012 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,
RSS feed for comments to this post