Moving WordPress From Local to Live
Many of the WP developers building their wordpress site in localy. Once you have finished the development on the local host, next step is to move it on production environment. You can use any backup plugin to easier migration. This tutorial give an idea about the how to move the local wordpress site to server manually.
- FTP access of live server
- Database access of Server
- Or Cpanel Access
1. Export your local Database
Take backup of your local database.
2. Upload your local files to the server
Using a FTP client like (Filezilla) upload your local files to server root folder.
3. Import your Database to the server
I assume you are already created one database in the server and added user to it. Then import your local database to the server.
4. Changing the wp-config.php
Edit your wp-config.php file in your root folder. Put the database user name,password and database name in it.
/** The name of the database for WordPress */
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
5. Changing the home and siteurl in wp-option table
Browse your wp_option table search field value siteurl change to your live URL, similarly search home and give the option_value as your live URL.
6. Rebuilding the slugs
Login to your admin panel using the url http://yoursitename.tld/wp-admin. Go to settings -> Permalink and save, This will recreate the .htaccess and ensure the link is not showing 404 Error.
7. Updating the Image URL and Other paths
WordPress store the site url and all when you are uploaded it self. If you are uploaded images and all in the local we need to update the paths. Go to your database and update wp_post table using the following query
Replace the yourfolder name and yoursitename with your values.