1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Quickly Upgrade xenForo If You Have Root Access [Deleted]

Discussion in 'Tips and Guides' started by Brent W, Aug 16, 2013.

  1. Brent W

    Brent W Well-Known Member

    BamaStangGuy submitted a new resource:

    Quickly Upgrade xenForo If You Have Root Access - Uploading files via FTP is a pain. Bypass that with this guide.

    Read more about this resource...
    Alien, Robert F Schmitz and Lone Wolf like this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Exactly how I do it.

    Upload the .zip file using WinSCP
    Log in via PuTTY
    unzip xen<press tab key to autocomplete the file name> to extract the contents
    cp -rf upload/* www/ to copy extracted contents

    Perform the upgrade

    Delete the files:
    rm xen<press tab key to autocomplete the file name>
    rm -r upload/ to delete upload directory

    Takes about a minute all in.
    Tim Jay, maszd, seojoseph and 2 others like this.
  3. Martok

    Martok Well-Known Member

    I do nearly the same thing as Brogan.

    Unzip the Xenforo zip file on the PC
    Re-zip just the contents of the upload folder (not the upload folder itself though, just what's in it) and call it something like upgrade.zip
    Upload the upgrade.zip file using WinSCP
    Log in via PuTTY
    unzip upgrade.zip to extract the contents, choosing to overwrite any existing files

    Perform the upgrade

    Delete the upgrade.zip file:
    rm -r upgrade.zip
    ARSamo likes this.
  4. RoldanLT

    RoldanLT Well-Known Member

    • Open terminal command
    • Navigate to your directory where XenForo-Upgrade.zip reside
    • scp XenForo-Upgrade.zip <user>@<IP>:/home/site
    • ssh -p <port> user@IP
    • cd /home/site
    • unzip -o XenForo-Upgrade.zip
    • php /home/site/public_html/library/XenForo/Install/run-upgrade.php
    • rm XenForo-Upgrade.zip
    seojoseph likes this.
  5. Brent W

    Brent W Well-Known Member

    What OS are you using? The -f flag doesn't work for me on Centos OS 6.3. Have to use the \ to kill it.
  6. MattW

    MattW Well-Known Member

    Does -f not work at all when you use cp ?
  7. Brent W

    Brent W Well-Known Member

  8. MattW

    MattW Well-Known Member

    What do you have in your bashrc file for root?

    I suspect you have the alias cp='cp -i' which is force root to prompt when using -f (it's a security measure to prevent you doing something stupid)
    Brogan likes this.
  9. Brent W

    Brent W Well-Known Member

    You are right:

    # .bashrc
    # User specific aliases and functions
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    # Source global definitions
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
  10. MattW

    MattW Well-Known Member

    This is why I allow my site account SSH and use that to manage the site unless I need to su into root for any server stuff.
  11. ProCom

    ProCom Active Member

    Wow, great resource and discussion!

    I have a question: While I'm in PuTTy, is there a way via SSH to "get" the zip file directly from xF server to my server vs. having to download to my local machine and then upload it?
  12. MattW

    MattW Well-Known Member

    No, because you have to select the version you want (and the full / upgrade version), along with accepting the TOS each time you download it.
  13. ProCom

    ProCom Active Member

    I'm going to have a go at my first attempt to upgrade my multiple installs of xF all on the same VPS in multiple accounts. I plan to upload the upgrade file to one account login via Putty using my root userID, and unzip it using putty. From there I'll run the cp command to copy over the files to each of the various accounts folders.

    When in PuTTY, when I unzip the upgrade all the files are then owned by "root:root" (since that account allows me access to all the files on the server). Once I copy the upgrade files over to the various xF folders they are copied over with this same root ownership. From past experience, this ownership being different from the account has caused problems with other scripts and I assume wouldn't be good for xF either.

    My questions:
    1. Is this something y'all deal with or do you login using the credentials of the account to which you are upgrading?
    2. Is there a way to use the cp command in a way that the ownership into the various accounts is set properly?
    3. Is the only way to do this is to recursively chown newaccount:newaccount to all the files in /home/account/public_html/* ??
  14. Brent W

    Brent W Well-Known Member

    cd into your public folder and then chown -R owner:group *
  15. ProCom

    ProCom Active Member

    Gotcha! I use to do this when I was manually upgrading 8 WP installs the same way... basically at the end of copying all the files I'd do:

    chown -R account:account/home/account/www/wp

    I'm assuming I'll do the same for xF, just do it one folder up since I'm installing all my xf forums in the account root:

    chown -R account:account/home/account/www

    I was surprised that non of the replies above address this ownership question. Are you all not changing the ownership of the files when they are copied over or was that step just omitted?

    WHOOPS! I just found out the hard way that changing /public_html to account:account caused me to get a 403 Forbidden error ! So, make sure public_html is set to account:nobody
    Last edited: Nov 25, 2013
  16. Brent W

    Brent W Well-Known Member

    That is why you cd into the public folder and use * :)
  17. ForestForTrees

    ForestForTrees Well-Known Member

    Just to be clear, my understanding is that as long as the "data" and "internal_data" hierarchies are read/writeable by the webserver and everything else is readable by the webserver, the website will function. From the perspective of the site functioning, it doesn't matter what account owns all of the files. File ownership only starts mattering when you need to start editing the files, etc. Clearly it's a good idea to have the forum account own the files, but it's not a webserver issue.

    From this perspective, copying all of the files over as root and then "chown -R owner:group *"ing seems like a good idea. Am I getting this right?

    Could you do the opposite? Could you "chown -R owner:group *" and then follow the instructions in this resource as the forum account? That would have the same outcome, right?
  18. ProCom

    ProCom Active Member

    I ran into this too, but a hack seems to do the trick in a pinch. Any experts care to comment on this:

    yes |cp -fRp upload/* www/

    That seems to force the "yes" on all the copied files.
  19. motowebmaster

    motowebmaster Active Member

    Gave this a shot on my upgrade to 1.2.4 and wanted to share my thanks. I spent more time backing up and testing on a non-critical directory than doing the actual copy to production and xenforo upgrade itself o_O
    Brent W likes this.
  20. ForestForTrees

    ForestForTrees Well-Known Member

    I did this and it worked just fine. It is appealing because I like to do as little as possible as root.

    As I've been mucking around more, creating a test server and upgrading, this seems to be correct.

Share This Page