SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict revlimiter's Avatar
    Join Date
    Sep 2005
    Location
    British Columbia, Canada
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fastest Way from LocalHost to Server?

    I am looking for the fastest way possible to take a full localhost version of WordPress (using MAMP Pro and Sequel Pro to develop locally) to my server? I have found a WordPress plugin called "WordPress Duplicator" that I haven't tested yet, but I don't know if it's the fastest, pain free, and most efficient way of doing so?

    I would like to develop my WordPress sites locally (so that I can work faster and also without WiFi when I'm on the go). So this would also include localhost updates, over time, to the server. And I suppose that it would also be vice versa, where I will want to take the full live site onto my localhost too. In essence, both should be in sync at all times, and I have my localhost folder inside Dropbox to help with multiple development workstations.

    Should I also get into the practice of copying the localhost site to a dev subdomain such as http://dev.domain.com first before taking it to the live domain http://www.domain.com?

    Thanks for your help!
    Any guidance is greatly appreciated.
    "To make an apple pie from scratch,
    you must first create the universe.
    -Carl Sagan

  2. #2
    SitePoint Member
    Join Date
    May 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good article about your question - knotrick[dot]com/how-to-move-wordpress-website-from-localhost-to-server-easily-using-plugin/

  3. #3
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Start using a version control system for your code, I'd recommend using Git. That way you can create a repo for your site theme (one repo per theme if you have more than one theme). If your server has a hosting control panel like cPanel then it most likely would have a quick WordPress installer. Use that or download & install WordPress on your site manually. Then clone your theme Git repo into the themes folder on server and activate your theme in WordPress. That's your one time setup pain.

    Now when you make changes to your theme on local machine, you commit & push your changes to your theme repo. On server you just have to do a "git pull" to fetch all those changes you pushed from your local. Two popular Git hosting services are Github & Bitbucket. On Github you will need to pay for private repos (else all your code would be accessible to public) while on Bitbucket you can have private repos on free account as well.

    Note that you would need SSH access on your server (where you're hosting your site) to be able to use Git there.

    If you don't have SSH access and can't change your hosting provider then you'd need a bit of a hack to go about painless updates.

    It'll be a 2 part solution:
    1. Write a PHP script which you can run on command line. It would do a git export on your theme and make a tar ball and then upload it to a dir on your server using FTP.
    2. Another PHP script on your server would check for existence of a tarball in that special dir and would untar it and replace the existing theme folder with the one that came from that tar ball. When done, it would delete the tar ball. You will need to setup this PHP script to run every X minutes or hours (your choice) via a cron job so it will automatically check in the dir for tar ball containing updated code and update it for the site.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •