Transfer WordPress Site From Local Computer to Server Without Reinstalling

Recently, I had to develop a website with a famous CMS – WordPress. I have version 3.2.1. I’m so happy with it, the last time I worked with WordPress was about 3 years ago, and I didn’t appreciate it the way I appreciate it today.

Transfer WordPress Site From Local Computer to Server Without Reinstalling
From your computer to your server.

So here’s what I went through, I have WAMP on my computer and so I downloaded WordPress, installed it locally and tried to play around with it. I downloaded free WordPress themes, modified them, saved articles, etc. So now, I thought that the WordPress site I worked on my computer is good enough to be online. I never thought setting up a website with WordPress is this easy.

So I uploaded my files to the server and exported the SQL database. I tried to browse the site and guess what, tons of errors were shown. I didn’t want to do a new WordPress installation on my server. So I had to hack some WordPress settings. Here’s what I did:

1. Export SQL from local PhpMyAdmin to online PhpMyAdmin (If you’re using PhpMyAdmin)

2. Copy WordPress files from localhost to server using Filezilla (or any FTP software)

3. Login and then create your online database with the same database name you have locally

4. Browse wp_options table

5. The first row (siteurl) contains your local url, probably http://localhost/YouSiteName, you have to change that to your online domain such as http://YourSiteName.com/

6. So now you can login to your online admin panel http://YourSiteName.com/wp-admin/

7. After logging in, Go to Settings > General

8. Change the site address (URL) to http://YourSiteName.com/, then hit save button

9. Again, Go to Settings > Permalinks

10. At the bottom part of it, you will see the correct .htaccess code.

Transfer WordPress Site From Local Computer to Server Without Reinstalling
Click to enlarge.

11. Copy it and access your current online .htaccess file and then paste the new .htaccess code, save and re-upload

That’s it! Now you have successfully transferred a WordPress site from your computer to Online server without reinstalling!


Comments

6 responses to “Transfer WordPress Site From Local Computer to Server Without Reinstalling”

  1. Anonymous Avatar
    Anonymous

    Nice , I am doing the same thing on Drupal.

  2. Hehe cool, I think we can do it in most cms. ๐Ÿ™‚

  3. I did not find a cleaner way to make it work, but still, this is a bad thing to have to dig into the database to deploy a wordpress site.
    Drupal is much more portable in this.

  4. @arnodmental: Really? For me, this is just fine. The site I deployed using this method is working well, just as a normal WordPress installation.

  5. yep,
    another way to do it, is to export the database in a sql file, then edit this file and do a replace of ‘localhost/mysite’ by ‘wwww.mysite.com’…
    This way, you’ll also keep the links to some pictures or some other resources …

  6. Thanks for sharing your way @acs04! ๐Ÿ™‚

Leave a Reply

Your email address will not be published. Required fields are marked *