Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 10 of 10

This is a discussion on Jag & Backup Problems in the Shared & Semi-Dedicated forum
Hello, I seem to have extremely bad luck, or there is an 'issue' with backup generation on the servers. I ran into a problem with ...

  1. #1
    JPC Senior Member PA-Scott's Avatar
    Join Date
    Sep 2001
    Location
    Bethlehem, PA
    Posts
    86

    Thumbs down Jag & Backup Problems

    Hello,

    I seem to have extremely bad luck, or there is an 'issue' with backup generation on the servers.

    I ran into a problem with an upgrade I had performed for my site. I did perform home directory backups, and a database backup, prior to doing the update. When I ran into problems, I decided to revert to my last working configuration, but I discovered the backup files had errors. I got the following:

    "! backup-husted.cc-9-29-2006.tar.gz: Unexpected end of archive"

    When I attempted to restore the database, I also received an error.

    I "try" to do backups at least somewhat regularly, but usually end up being once every couple of months. I have two domains on two different Jag servers and I checked the 2 most previous backups for both my sites and ALL 4 of the backups gave the Unexpected end of archive problem.

    So I contacted Jag and asked them to perform a backup for me. This was on Saturday I believe. They said the most recent backup was from Thursday. That was OK, since I didn't do anything major with the site in those 48 hours that were in that database. The restore of the Thursday backup that Jag performed was not correct. It resulted in about 2 months of lost data... Luckily, Jag performed a backup of the database before doing the restore and was able to successfully restore the backup as it was (modified by me in my failed upgrade, but was not effecting the running of the site when I reverted to old upload).

    So in summary, not only did I have 4 home directory backup files all generated through cpanel with unexpected end of archive errors, but the two database backups I had were corrupt and failed to restore when I attempted to do so, AND.. the backup that Jag had on file was corrupted and not actually the backup of the date being reported.

    I have a ticket open, not because I'm still having problems with my site.. but I'd like to get someone to look at the backups and determine whats going wrong and if it's been corrected. It's pretty deflating to think you have backups, only to find out you don't - especially when its happening to two domains on two different servers.

    I can manually download, via FTP, the whole home directory... but I'm not an expert at this and not sure how I would manually do a database backup?
    Scott B. Husted

  2. #2
    Ron
    Ron is online now
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    Create a file called backup-databases.sh in your /home/acct directory. in it:
    Code:
    mysqldump -u ACCT_DBUSER -pDBUSER_PASSWD -a --all-databases |gzip -9 >database-backup-$1.sql.gz
    Then chage it's permissions to make it executable like this:
    Code:
    chmod 755 backup-databases.sh
    Call it like this (assuming today's date):
    Code:
    ./backup-databases.sh 20061004
    This will create a dump of all of your databases associated with that database user. If you have more than one user, add appropriate lines to the .sh file, taking care to differently and appropriately name the backup files. For example:
    Code:
    mysqldump -u ACCT_DBUSER1 -pDBUSER1_PASSWD -a --all-databases |gzip -9 >database1-backup-$1.sql.gz
    mysqldump -u ACCT_DBUSER2 -pDBUSER2_PASSWD -a --all-databases |gzip -9 >database2-backup-$1.sql.gz
    Then get yourself a copy of WinSCP. Create a directory on your PC to hold your new backup scheme. The directory should be empty. Navigate in the left panel to your new PC directory, and in the right panel to your /home/acct directory. With the right panel highlighted, run the database dump scripts as described above.

    Now it's time to run the Synchronization feature of WinSCP. The first time it is run, it will copy everything in your directory to your pc (Be sure that your SERVER SIDE is highlighted when you click on the synchronize button, otherwise it will go the other way, a disaster). This might take a long while if you have a huge amount of files or data. The second time sync is run, it will copy only files that have changed on your server to you PC, a very quick thing.

    If you have a smaller account, this could be done by tarballing your entire account into a single tarball and downloading that instead of everything individually, but once you get into a larger amount of files and data (I've got about 6Gig of stuff, for instance) transferring that size of a backup every day is just unfeasible.

    Good luck!
    Last edited by Ron; 10-04-2006 at 10:50 AM.

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Perhaps this will help...

    http://jaguarpc.com/forums/showpost....2&postcount=48

    This is the method I use. Works every time!

    BTW, for backing up my sql dbs, I use phpMyAdmin...

    Simple pimple!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    JPC Senior Member PA-Scott's Avatar
    Join Date
    Sep 2001
    Location
    Bethlehem, PA
    Posts
    86
    Ron and Vin,

    Thanks for the advice... I'll have to check into doing what you guys suggested and see what I come up with.

    Vin.. as your post indicates, I no longer trust cpanel either. I'm not overly comfortable using command line, but I've screwed up enough Linux installations on spare PCs that I can probably figure out how to do it, and then figure out how to mess it up.
    Scott B. Husted

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by PA-Scott View Post
    Vin.. as your post indicates, I no longer trust cpanel either...
    I'm a Cro-Magnum when it comes to backups! To my way of thinking, the simpler the better -- the more likely I'll do them -- and the more likely they'll work!
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    Ron
    Ron is online now
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    Like I said, I'd prefer to tarball everything up and download it; that's the way I did it until I hit about 2Gig, give or take.
    Now it takes just about 15 minutes to take an incremental backup. The dump/gzip takes about 3, the WinSCP scan takes about 6 and the downloading takes about 5 or 7 (depending on number of files uploaded that day).

    If I need to restore after a disaster, I can upload my database, restore it, restore my main site and forum and other dynamic code and be back in business in practically no time at all. Then upload the bandwidth intensive pics over the next day or two, when other people are desperately also trying to upload their sites.

  7. #7
    JPC Guru
    Join Date
    Mar 2005
    Posts
    361
    Ron, just a suggestion:

    if you have multiple databases and each has an associated user, you don't need to create multiple lines of mysqldump to download them.

    you can simply create a single user who has access to all the databases and you can just use that user to download them all in one go.

  8. #8
    Ron
    Ron is online now
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    I have a "master user" in each account where there are multiple DBs.... Can you create a user that has access to DBs across accounts on a shared server? I never though about doing that.

    Maybe not through CPanel...

    After my migration maybe I'll play with this... too much other stuff going on right now, but that's a cool idea.

  9. #9
    JPC Guru
    Join Date
    Mar 2005
    Posts
    361
    You are right, it can't happen with cpanel because it only allows you to assign users to databases associated with the account only.

    At least a master user can access multiple databases of the same account, so thats something.

  10. #10
    all about nothing! Frank Broughton's Avatar
    Join Date
    Jan 2006
    Posts
    2,158
    Quote Originally Posted by Ron View Post
    I have a "master user" in each account where there are multiple DBs.... Can you create a user that has access to DBs across accounts on a shared server? I never though about doing that.

    Maybe not through CPanel...

    After my migration maybe I'll play with this... too much other stuff going on right now, but that's a cool idea.
    Yes it is - I would be very interested to see if it would work on DB's across accounts.

    Vin can one do this with PHPmyadmin?

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
  •