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.

How to restore a full backup?

Discussion in 'General Discussion' started by SprintSlash, Jan 18, 2003.

  1. SprintSlash

    SprintSlash Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    163
    Likes Received:
    0
    Trophy Points:
    16
    I saved a full backup (in tar.gz) of a site generated by Cpanel on the server. I wish to restore the entire thing. I know I can restore it using Cpanel, but that means I will have to download the huge file and upload it (which will take days). Does anyone know how to do that without needing to upload the huge file from my web browser? or any ways I can do it via shell?
     
  2. drose25

    drose25 Well-Known Member

    Joined:
    Apr 3, 2002
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    I'd like to know if this is possible as well. I have a fairly large user account that just won't transfer with account copy. I backed up his site using the full site backup and ftp'ed it to the new machine so I wouldn't have to download and then upload a 300mb file.

    Now I can't figure out how to restore it. The Cpanel interface doesn't allow a locally hosted file to be entered.
     
  3. drose25

    drose25 Well-Known Member

    Joined:
    Apr 3, 2002
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    DO NOT use the upload backup feature in Cpanel to restore a FULL backup. This feature is apparently designed only to work with HOME dir backups.

    I uploaded a full backup using that method last night and all it did was untar the full backup in a directory called backup-0.18.2003_20-18-09_username in the user's /home/username directory. There's a full version of his site under that directory, mind you, but nothing was copied to his main public_html directory, no databases were re-created, etc. so it really had no useful effect. I could have done that from the command line and not spent 7 hours uploading a humongous file. :)

    Since this user has some mailman archives and other things he really wants transferred, I am thinking I will delete the contents of his homedir at the old site, then use the Cpanel transfer function since his account should then be small enough, and then just untar the files back into the right directory. May or may not work for you depending on how large an account you can transfer and how much space is used with databases, etc.

    If you have shell access at your old site you're transferring from, do a &df -v& command to see disk space available. You're interested in the /tmp directory. You may also be able to see this info from WHM if your host hasn't disabled the service status link. The space available there pretty much determines how large the tarball for the account you want to transfer can be.

    Hope this helps!
     
  4. drose25

    drose25 Well-Known Member

    Joined:
    Apr 3, 2002
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    Cpanel support said to use /scripts/restorepkg to unpack full backups.

    Ex:

    /scripts/restorepkg username

    Note that your backup will need to be in the home directory and named cpmove-username rather than the long backup file name that is generated by default.

    I didn't have any luck getting this to work properly, primarily I got the same error I did when transferring an account. I think it stems from incomplete or malformed tarballs on the original server side. Your mileage may vary.

    Good luck.
     
  5. hockeythug

    hockeythug Registered

    Joined:
    Dec 22, 2001
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    This is true, and it does work. However, cpmove-username must be the name of the directory that you unpacked the backup tarball into, not the tarball itself. Once I made that change, this worked beautifully.

    Hope that helps someone out there.

    cPanel.net Support Ticket Number:
     
  6. shub

    shub Member

    Joined:
    Jul 29, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Ok... got the account to backup and i restored it on the server. In my case I was transfering an account from one server to another. I also think that the initial server had a previous version of cpanel on it (didn't have root access) and the new server has the latest (have root access).

    Everything looks good initially but when i update the account packages the sever space qouta on their account keeps defaulting to 'unlimited'. even if i change it by going to modify qouta.

    Any thoughts? is there a script to update old versions of cpanel accounts to new versions or is there an account repair script that might do the trick?

    - Sam

    cPanel.net Support Ticket Number:
     
  7. Arvand

    Arvand Well-Known Member
    PartnerNOC

    Joined:
    Jul 26, 2003
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    18
    Thats just a general bug when you move accounts. It happens to my accounts from the same cpanel version too. run /scripts/fixquotas after you do the changes. It will take long but it will fix the quotas for you.

    cPanel.net Support Ticket Number:
     
  8. rix

    rix Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    hmm...
    im having problem while running /script/restorepkg rix

    its says
    Extracting Domain....Done
    Sorry, the copy failed. Unable to find the cpanel user file

    in /home/rix theres a file backup-<date>_<unknow>_rix.tar.gz

    so...what does it means by unable to find cpanel user file

    cPanel.net Support Ticket Number:
     
    #8 rix, Aug 29, 2003
    Last edited: Aug 29, 2003
  9. bonnmac

    bonnmac Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    I'm having the same issue. I've already tried all the methods in this post and I get this same error with everyone method.

    Any other ideas?

    cPanel.net Support Ticket Number:
     
  10. rix

    rix Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    I just found the solution. untar the backup_<date>_<unknown>_<user>.tar.gz then the directory backup_<date>_unknown>_<user> will showed up. After that just rename that folder to cpmove-<user>. Make sure the cpmove-<user> dir is in ur /home then you can run /scripts/restorepkg <username>. I found out that if the user dosen't exist, it will create it and if its there, it would just override the current file. I find it alot more better to transfer user this way then using the transfer tool as its buggish.
     
  11. bonnmac

    bonnmac Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    What tar directives did you use? zxpf?

    cPanel.net Support Ticket Number:
     
  12. comyc

    comyc Registered

    Joined:
    Sep 4, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Castellano

    Hay alguien que pudiese traducir este hilo al castellano.
    Con los traductores se consigue un pupurri de la ostia.
    Gracias

    cPanel.net Support Ticket Number:
     
  13. Arvand

    Arvand Well-Known Member
    PartnerNOC

    Joined:
    Jul 26, 2003
    Messages:
    130
    Likes Received:
    1
    Trophy Points:
    18
    tar -xzvf filename is what i used

    cPanel.net Support Ticket Number:
     
  14. rix

    rix Well-Known Member

    Joined:
    May 1, 2003
    Messages:
    68
    Likes Received:
    0
    Trophy Points:
    6
    i use tar zxf for .tar.gz files :)

    anyway just to clear things up on how i did the /script/restorepkg

    assume the backup file named as following

    /home/backup-00-00-00_11-11-11_rix.tar.gz
    tar zxf backup-00-00-00_11-11-11_rix.tar.gz
    mv backup-00-00-00_11-11-11_rix.tar.gz cpmove-rix
    /scripts/restorepkg rix

    on starting of the script should have error because it could't find the .tar.gz file but it will continue processing the backup folder (cpmove-rix)

    cheers :D

    cPanel.net Support Ticket Number:
     
  15. d-woo

    d-woo Well-Known Member

    Joined:
    Aug 9, 2003
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Rix...but there is a slight error on line #3 above.

    It should read:
    3. mv backup-00-00-00_11-11-11_rix cpmove-rix

    (without the .tar.gz after 11-11-11_rix)

    It should read as follows:

    Code:
    assume the backup file named as following
    
    /home/backup-00-00-00_11-11-11_rix.tar.gz 
    tar zxf backup-00-00-00_11-11-11_rix.tar.gz
    mv backup-00-00-00_11-11-11_rix cpmove-rix
    /scripts/restorepkg rix
     
  16. d-woo

    d-woo Well-Known Member

    Joined:
    Aug 9, 2003
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    6
    Using what rix has given us....

    B. RESTORING THE FILE

    assume the backup file is named as follows:
    /home/backup-00.00.00_11-11-11_username.tar.gz tar

    it will probably best be located in a backup directory in root, e.g. /my_backups
    /my_backups/backup-00.00.00_11-11-11_username.tar.gz tar

    Regardless of where it is located:

    Step 1. In SSH go to where the file is located:
    root# cd /my_backups/backup-00.00.00_11-11-11_username.tar.gz tar

    Step 2. Untar/Unzip the file
    This will expand into a directory with the same name as the file (without the .tar.gz. on the end)
    root# zxf backup-00.00.00_11-11-11_username.tar.gz


    Step 3. Send a copy of the directory to the home directory (renamed as cpmove-username)
    root# mv backup-00.00.00_11-11-11_username /home/cpmove-username

    Step 4. Execute the backup script
    root# /scripts/restorepkg username

    Step 5. Check/change permissions
    For whatever reason my chmod settings for /home/username/public_html were 750 and I changed it to 755 (751 might also work)

    In SSH
    root# cd /home/username/
    root# chmod 755 public_html

    Step 6. Reinstall any SSL Certs via WHM
     
    #16 d-woo, Oct 17, 2003
    Last edited: Oct 17, 2003
  17. Aylwin

    Aylwin Member

    Joined:
    Oct 31, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tampere, Finland
    Is there any way to restore the full backup without shell access? I don't have shell access on my account. I tried to go around this by creating a cron job. It didn't work. I got "Permission denied".

    Do I need the admin's help? Any way around it?
     
  18. eurorocco

    eurorocco Well-Known Member

    Joined:
    Jun 23, 2003
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    This shows Cpanel is fundamentally lame

    I cannot believe Cpanel has Full Backup but no Full Restore from a web site admin Cpanel interface. It's quite unbelievable. It's quite a disaster. Quite a sorry Bummer! REally.

    Most sites do not have shell access and most webmasters do not drive the Linux shell proficiently.

    ER
     
  19. Aylwin

    Aylwin Member

    Joined:
    Oct 31, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tampere, Finland
    Myself, I like cPanel although I must admit I have nothing to compare it against. All this web building and maintenance is very new to me.

    And being a newbie, I find it very disappointing that cPanel has no easy way to restore a full backup. To me, being able to perform a full backup and restore it is one of the most basic and important features of a domain/web account GUI.

    If a full restore can be done in the 6 steps described by d-woo then why wasn't cPanel programmed to do that when I click on "Restore"?

    As it was, I couldn't afford to sit around and wait for help so I had to restore my website the hard way given my limited experience. I'm sure you gurus will laugh but this is what I did:

    1) Decompressed the full backup using cPanel's restore. Took forever but I have no shell access and know no other way.

    2) Manually moved everything under the backup directory's /public_html to my "real" home/username/public_html/.

    3) Installed Apache, PHP, MySQL, etc. on my home PC.

    4) Create my SQL database on the home PC and copied database folder under the backup directory's mysql folder to my PC.

    5) Created/exported the .SQL file and used it to restore my SQL database on the web host server.

    6) At that point the website was up and running but then I also had to manually recreate the subdomains and email accounts.

    7) Moved all the mail folders from the backup directory to the proper path: /home/username/

    By the way, using cPanel's File Manager, how do you copy a file or folder to your root folder? It seems I always need to click on a destination folder (under the root) but I can't find an option to choose the root itself.

    Anyway, the work was a pain in the behind and I'd rather not have to go through the experience again. If there's a simpler way (without shell access), I'd really appreciate it if someone would share the procedure with me.

    Or, is cPanel's restore function going to work properly sometime soon?
     
  20. eurorocco

    eurorocco Well-Known Member

    Joined:
    Jun 23, 2003
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    6
    The only way to get full restore...

    Dear DarkORB!

    Is there something root can do to enable full restore for site admins (Cpanel 8.5)?

    Is it something you can implement for the site admin level?

    It's needed badly!

    I read some of you tring to restore sites piece by piece... it's overkill. Just look at what's inside those .tar.gz full backups from a fully-loaded site... databases, database users, emails, email accounts, email filters, email aliases, site settings, web content, etc., etc.

    As Cpanel seems to stand one must either be root (get a dedicated server) or have a good root friend willing to do full restores from the shell. Am I wrong?

    ER
     
Loading...

Share This Page