Since we're talking about SSH clients

Discussion in 'Server Administration' started by Mike54, Nov 1, 2011.

  1. Innocent

    Mike54 Supporting Members

    Likes Received:
    271
    Software You Use:
    XenForo
    I don't want to get busted for taking the other SSH client thread off-topic, so I'll just start a new one.

    One of the things I would like to learn is a faster method of updating my sites. For years, I've downloaded .zip files, unzipped them on my desktop and used an FTP client upload everything to my sites. It works and works well. But it would be nice to speed the process up.

    What I would like to see is a step-by-step tutorial from someone, explaining where to upload the zip file and then how I can use SSH access to unpack everything and run the upgrade.

    Dan, is this something you're up to doing? Anyone?
  2. Sleepy

    TheRevTastic I don't want to be George Michael

    Likes Received:
    63
    Software You Use:
    IPB, XenForo
    I would love to see a tutorial on how to do it with Xenforo or IPB without even having to download a file onto my computter, IIRC the command is wget, but I don't really know how to use it.
  3. Spaced

    KW802 Code Monkey

    Likes Received:
    141
    Software You Use:
    IPB, vBulletin, XenForo
    For XenForo, check this thread:

    http://xenforo.com/community/threads/upgrade-using-zip-file-directly-on-server.20928/ :)

    You're going to need to download the zip to your local PC before uploading to your server since XF at least requires you to be logged into your account in the members area in order to generate the download file (in other words, you can not FTP the file or wget the file directly from your server).
  4. Michael Biddle Senior Member

    Likes Received:
    15
    Like Kevin said, you typically will not be able to download the files straight to your server due to customer credentials.

    Typically these are my steps (assuming that your hosting home directory is in /home/username, your document root is in /home/username/public_html, and the zip file is named filename.zip):

    Actual commands are highlighted in red.
    1. Download the zip file provided from your software to your computer
    2. Upload the zip to your server to a blank folder such as /home/username/test (Make the test directory)
    3. Login with your SSH client (PuTTY on Windows is what I would recommend, or Terminal on a Unix system)
    4. Type the following command into your SSH client: cd /home/username/test (This will change your directory to the test directory that you just uploaded the files to)
    5. Type the following command into your SSH client: unzip filename.zip (This will unzip the archive)
    6. Type the following command into your SSH client: cd upload/ (The upload folder might be named something different depending on which software you install. However, the directory that you will cd into should be the files/folders that will be going into the document root)
    7. Type the following command into your SSH client: cp -R * /home/username/public_html/ (This will copy all of the files and folders recursively from your local directory [/home/username/test/upload/] to your document root [/home/username/public_html/]. Also, on some systems, you may get the server asking you if you are sure that you want to overwrite each file. To automatically bypass that, you can pipe a yes in front of this command to auto type yes by tying the following command into your SSH client: yes | cp -R * /home/username/public_html/)
    8. Run your install/upgrade script from the web interface.
    9. Remove your temporary test directory that you uploaded and unzipped originally by typing the following command into your SSH client: rm -rf /home/username/test/
    You potentially might have to remove a few files after install (Such as install.php in vBulletin)
  5. Innocent

    Mike54 Supporting Members

    Likes Received:
    271
    Software You Use:
    XenForo
    Michael, you are a gentleman and a scholar. Many thanks for posting this information.
  6. Caffeine Fix

    Big Dan Will Work For Coffee

    Likes Received:
    14
    Software You Use:
    vBulletin, myBB
    Great tutorial Michael! :)

    I generally only untar server side when first setting up a site or else files I don't want to be over written (favicon.ico, custom index.php, etc) are over written. When that happens, I have to pull down a 4GB backup just to get a put back a couple of files, major waste of time. Untarring to a temp folder and moving them seems like just as much work as uploading from my computer.

    Other than that if I'm on a slow/unstable connection or moving a large site I'll wget a tarball and do everything on the server.
  7. Innocent

    Mike54 Supporting Members

    Likes Received:
    271
    Software You Use:
    XenForo
    Dan, I noticed that. But I thought it would still be faster for me to unzip the package on my desktop, remove all the unnecessary files, then sip things back up and do the upload. I'm not sue where other forum packages are, these days, but the recent IPB packages amount to some 3,030 files to be uploaded. The time I would save in the upload would more than cover the time required to prep everything prior to the upload.
  8. Caffeine Fix

    Big Dan Will Work For Coffee

    Likes Received:
    14
    Software You Use:
    vBulletin, myBB
    Same here the vB 4 packages seem ridiculously oversized compared to 3.8. I'll have to reconsider downloading, removing files, then tarballing the rest and uploading it. It'd be nice if vB would release 'patch' downloads like they do with security patches with only the changed files.

Share This Page