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

MYSQL DB backup

Discussion in 'Website Design Forum:' started by Jazajay, Oct 15, 2010.

  1. Jazajay

    Jazajay Active Member

    Hi guys and gals,
    Right we need a way to automatically backup our MySQL databases remotely.
    We have 100+sites that need to be backed up at least once a week and we want to have a copy of the SQL file.

    All the servers are run by hosting providers so it can't be a cron job.

    Any solutions?
     
  2. Mark Alexander

    Mark Alexander Senior Member

    Well what do you mean automatically?

    Automatically create a dump on your server? On your workstation?

    Automatically as in without any human involvement, or just a script that runs and does it all when you want it to?
     
  3. Greg

    Greg Active Member

    Are the 100+ sites on the same server Jay?
     
  4. Sunburn

    Sunburn Active Member

    You could write a cron job to do it mate, assuming they are all on the same server?
     
  5. Greg

    Greg Active Member

    Assuming sites are on different servers, or they don't have cPanel access for cron jobs?
     
  6. glenwheeler

    glenwheeler Senior Member

    This is true :) Same server, peezey easy!
     
  7. Sunburn

    Sunburn Active Member

    time for a new host :) by the sounds of it .
     
  8. Jazajay

    Jazajay Active Member

    Okay thanks peeps, been really busy but don't get me wrong I really do appreciate the time, honestly. :angel:

    Right just to clarify as I think I could have done a better job by some of the responses so far, my fault, as I've got more clafication since as well. It wont change the answer(s) but I like to be spot on. Its now only 24-30 sites but with a look at more in the future. Basically all the other sites are backed up automatically by my boss man on a weekly basis then if it all goes wrong we have a copy, his specaility is servers and networking so I'll leave that to him.

    But the sites he wants to have backup copies of the databases on a weekly basis are all Joomla based and are on the same hosting provider. They are with Heart, I think are where all our Joomla ones are located, the hosting side of things is the one area I have little control over. But he wants it done automatically encase one of our sites we manage employee screws up the DB it gets hacked etc... Not manually as one it would take time to do it, something with our current work load I couldn't really afford to allocate but if the guy who normally does it was off, sick hol, it wouldn't be done for 2 weeks and it would be in those 2 weeks it would need to be done, all ways is. : )

    @Mark
    We also run our own server, not where the sites are located on. If the sql files could be backed up on to that maybe then they could be backed up with the weekly server backups at our end. However they would need to be remotely sent to our server first from thiers to do this.

    @Greg
    I would imagine not but they are with the same provider.

    @Sunburn
    Cant dude as we don't control the server per-say but good suggestion. :)

    @Greg
    Cron jobs are in the Cpanel?????
    Never noticed that and don't have access to my remote work station login at mo to test. Aww that may be what I need to look into, I will do when I get in Monday morning.

    Now just encase that doesn't do it are there any other suggestions?
    My boss says if it has to be a paid service then fair does, obviously I woulld prefer it not to be, makes me look better the more money I save but....

    Thanks so far peeps very much appreciated.

    Jaz :)
     
  9. Jazajay

    Jazajay Active Member

    Hi I have finally got back round to this. Again thanks for everyones time. :)
    Right from a bit of looking I am asumming mysql dump is the way to go. Anyone have an idea how I run a MYSQLDUMP SQL command via PHP to achieve this though as I'm a little lost at that bit. :eek:

    All answers will be highly appreciated, believe me. :)
     
  10. Levi

    Levi Moderator Staff Member

    um.... ok different tack here :)

    Just looked in my cpanel and I can see a 'web disk' option.

    this is
    and you could set this up to link to the database folder and then map it as a network drive on a pc/server.

    Once mapped you can set up a one way backup of said folder using something like sync toy (free) and then schedule it to do it every x days.

    So for the simplified version (I know you like my simple versions Jaz :p)

    Server - set up web disk accounts for mysql database folder

    On pc (ideally an always on server) - map web disk location to mapped address (I can explain more if needed)
    Set up sync software to download from web disk on regular intervals.

    Repeat for each server.

    You can either stick them all in one location and then individual folder them or you can give each individual mapped drives.


    A mapped drive is basically a drive from another computer/device (must be turned on) which will appear as a standard hard drive on another pc. I use this at home to map folders from my nas and they work very well.
     
  11. Jazajay

    Jazajay Active Member

    Thanks Levi. :)
    Yeah your right I do like simple things, I mean ABC what now???? :confused:

    Just had a look and mine/where I need to be running this doesn't appear to offer it (Heart in this case) I could be wrong but I don't see it. They do offer a scheduled file run thingy which is why I thought using PHP to generate a MYSQL dump and stick it in a file in a certain folder would be good then I could just direct the FTP to pick it up at a certain time then create another script to run after it which deletes the file thus not taking up too much space.

    But I can't seem to work out how to get PHP to dump the database into a nice correctly formated file for me, I'm pretty sure it can be done. :)
     
  12. Levi

    Levi Moderator Staff Member

    it's under the 'files' section in my cpanel if that helps, along with backups and backup wizard, file manager etc
     
  13. Jazajay

    Jazajay Active Member

    I have backup restore but cant find any autoamted process in their. In regards to my file section and backups thats it. :(
     
  14. eonic

    eonic New Member

    I have a script that emails the db backup files as a zip - via nightly cron - will see if i can dig it out
     

Share This Page