Uploade WordPress Site From Local Server to Live Site

By
Develop a WordPress site  on Localhost . It  can help speed up the development process.After you have finished the WordPress site development on localhost, the next step is to move the site to live Server.

Some Pre-Steps
                First You Need a live web server to upload site who support WordPress & a Domain name .
                You  need to have C panel details of server or a FTP program , so you can upload your content to the live Server.

Step 1: Export  WordPress Database Backup  from Localhost
First  you need to backup  your local WordPress database.In WAMP  We will be using phpMyAdmin to do that. Simply go to http://localhost/phpmyadmin/ and click on your WordPress database. Then click on the Export button from the top menu bar.








Step 2: Uploading All WordPress Files to Live Site Server

Open CPanel of your server  using URL https://www.yourdomain.com/cpanel and login .
 In cPanel dashboard  click on the File Manager icon which can be found in the Files section.




Step 3: Creating MySQL Database on Live Site Server

 In cPanel dashboard  click on the MySQL databases icon which can be found in the databases section.

Create New Database 



Step 4: Importing WordPress Database on Live Site

 In cPanel dashboard  click on the phpMyAdmin icon which can be found in the databases section.
phpMyAdmin will show your new database with no tables. Click on theImport tab in the top menu. On the import page, click on choose file button and then select the database file you saved in step 1. and  import your WordPress database.

Step 5: Now Change the Site URL

Now you need to change the site URL, so you can setup your live WordPress site. In your phpMyAdmin, look for the wp_options table in your database. and Click on the wp_options link that you see in the sidebar to open the page with a list of fields within the wp_options table.
Under the field options_name, you need to look for siteurl. Click on the Edit and change option_value to your live site URL

And also in  options_name, you need to look for home. Click on the Edit and change option_value to your live site URL

Step 6: Setting Up your Live Site
Now that we have imported the database, and all your site content should be uploaded, Now you configure WordPress. At this time, your site should be showing an Error Establishing Database Connection error. To fix this error  edit wp-config.php file. Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file to your server. 
Now Login to your WordPress admin panel, and go to Settings » General. Click save Options. This will ensure that the site url is corrected anywhere else that needs to be.
Then go to Settings » Permalink and click Save to ensure that all post links are working fine.

Step 7: Fixing Images and Broken Links by updating Paths

Whenever you are moving a WordPress site from local server to a live server site, you would face broken links and missing images issue. You can use the SQL query 
UPDATE wp_posts SET post_content = REPLACE(post_content,'localhost/myproject/''www.yourlivesite.com/');

Run All Thease Query

UPDATE wp_commentmeta SET meta_value = REPLACE(meta_value,'localhost/myproject/', 'www.yourlivesite.com/');


UPDATE wp_comments SET comment_content = REPLACE(comment_content,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_links SET link_description = REPLACE(link_description,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_options SET option_value = REPLACE(option_value,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_posts SET post_content = REPLACE(post_content,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_posts SET post_title = REPLACE(post_title,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_term_taxonomy SET description = REPLACE(description,'localhost/myproject/', 'www.yourlivesite.com/');

UPDATE wp_usermeta SET meta_value = REPLACE(meta_value,'localhost/myproject/', 'www.yourlivesite.com/');


0 comments:

Post a Comment

Powered by Blogger.

Blog Archive