The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Overwriting files with File manager

Discussion in 'General Discussion' started by Aylwin, Mar 28, 2006.

  1. Aylwin

    Aylwin Member

    Joined:
    Oct 31, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tampere, Finland
    I wish there were more facilities for overwriting files from within File manager. All I am aware of is that I can overwrite files when uploading individual files.

    I wish there was an overwrite tick box for extracting archives. This makes upgrading CMS packages and the like so much easier. Or, it would be good if I could copy/move one directory to another with an overwrite option.

    Are any of the above possible? If not, are there any plans to include this type of functionality in the future?

    Thanks,
    Aylwin
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    It can't get any easier than this.

    -Go to cPanel and pass protect your root account for a few minutes.
    -Login via your FTP client and create a folder outside of public_html to work in. Lets call it workroom.
    -Upload your CMS package there in zip file.
    -Create a new folder in there called old.cms or whatever you like.
    -Using file manager from within cPanel, unzip that file you uploaded.
    -Say your CMS is in the root directory, go there via FTP and highlight all files for the CMS, nothing else*, and then right click and choose cut. Move back to insdie of old.cms and right click again and choose paste.
    -Now go to the new folder that you unpacked and highlight all files in it that you need and choose cut.
    -Navigate back to the root directory where the CMS belongs and paste the new files.
    -Run upgrade as needed.
    -Move files back later from old.cms directory that you may need. Like themes, hacks and whatever else.
    -Once the site works fine, delete (or not) the old.cms directory you created.
    -remove passprotection on site.

    *make sure you don't remove system files like cgi-bin, htaccess, error pages like 404.shtml and others.

    If all goes well you should have been able to upgrade and reopen your CMS in about 15 minutes. Less if you don't stop for a cold beer. ;)

    HTH
     
  3. Aylwin

    Aylwin Member

    Joined:
    Oct 31, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tampere, Finland
    Well, it could get easier if I could do the following all from within cPanel File manager:
    1) upload the new version CMS archive (could be zip or tar.gz)
    2) extract/unzip the archive with overwrite option
    3) run the upgrade script

    If an overwrite option was available on archive extract then that would be it. All the new CMS files would overwrite the old ones while leaving the config files, themes, modules, plugins, hacks, etc. alone. Plus, no need for FTP either.

    As it is now, I need to use an FTP client and go through just as many steps as you've described.

    The "nothing else" is actually the tricky part. I can't highlight everything except the config file (and maybe .htaccess and php.ini) at the root level, the themes under one folder, the plugins/modules under another, and so on. The problem with "nothing else" is that it may involve different directories at different levels. In which case, you're going back and forth with this step several times.

    But, the procedure you've described has given me an idea. Would this procedure be possible:

    1) create a new folder, say "new.CMS", outside of public_html
    2) upload the the new version CMS archive and extract/unzip the contents
    3) copy/move ALL the files and folders of the current CMS to the new.CMS folder
    4) delete ALL the files and folders of the current CMS
    5) move ALL the files and folders under the new.CMS folder to previous CMS location
    6) run the upgrade script

    It's step 3) that I'm not too sure about. If I copy or move with duplicate files and folders would the operation be cancelled or would it still transfer the non-duplicated ones. In other words, if I copy folder A containing X, Y and Z over to another folder A containing only X and Y, would I end up with 2 folders A containing X, Y & Z? If yes, then my procedure should work, right?

    Anyway, I guess there's one way to find out...
     
  4. Aylwin

    Aylwin Member

    Joined:
    Oct 31, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tampere, Finland
    Very strange. :rolleyes:

    When I copy one folder over another with the same name (and almost the same contents) some files are overwritten and some aren't. I haven't figured out yet which files or file types are overwritten but this doesn't make sense to me. Either all files should be overwritten or not at all. Somewhere in between is confusing... unless there's documentation somewhere on this?
     
  5. kenlyle

    kenlyle Registered

    Joined:
    Dec 14, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Great idea, Alwyn!

    The ability to tick a box when unzipping an archive would be a GREAT, much needed feature, and probably save thousands of support hours per year, globally. Of course, it could create some errors, too, but with Fantastico, and a couple of patch sets, it would be easy to rebuild any application to any point in a minute or two....I think.

    Hopefully, the cPanel devs tune in here once in a while...

    K
     
  6. Tarindel

    Tarindel Registered

    Joined:
    Jul 10, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
  7. gwmbox

    gwmbox Member

    Joined:
    Apr 5, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Australia
    Yeh well my 'host' has disabled the unzip feature 'for security reasons' what they are I am still trying to find out - anyone got any other solutions?

    I was actually very surprised it was not an option in cPanel 11 - I mean as many have said it is a well sought after feature being requested - is there a reason it is not available or already a part of cPanel?
     
  8. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The new File Manager will unzip your PKZip files. Simply select the file and click the Extract button. It handles PKZip, TAR, GZip and BZip2 formats.
     
  9. gwmbox

    gwmbox Member

    Joined:
    Apr 5, 2003
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Australia
    But not overwrite!
     
  10. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This is a known shortcoming in File Manager: http://bugzilla.cpanel.net/show_bug.cgi?id=5588

    A kludge I use in the meantime is start by creating a folder via File Manager. Then place the zip file in that folder and extract it. After that, in File Manager, I select the entire contents of that folder (don't forget about the select all button in the toolbar) and simply drag it to the location I originally wanted to extract the file. This will automatically overwrite all of those files.
     
  11. headout

    headout Well-Known Member

    Joined:
    Aug 20, 2003
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page