Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18

Making full site backups

This is a discussion on Making full site backups within the Member Articles forums, part of the Focus on Members category; Requirements: SSH Access, Hosting Account, Linux, Backup Solution, 30 minutes! What you're about to learn: How to backup your site ...

  1. #1
    Senior Member
    Real Name
    dave
    Join Date
    Jun 2006
    Posts
    348
    Liked
    0 times
    Blog Entries
    1

    Making full site backups

    Requirements: SSH Access, Hosting Account, Linux, Backup Solution, 30 minutes!
    What you're about to learn: How to backup your site with a reliable, tried and true method that will provide a fail safe solution in case of a emergency!
    Definitions: Off Site Backup - moving data off the current server, to a backup solution.
    SSH: A way to issue command your server from home.


    Do you have a forum full of data, all your images, attachments, users, posts everything is only one mistake away from being completely lost for ever. Everyone should know how to fully backup their site, and move the backup off their servers to another location in case the unthinkable happens, trust me it happens the only question is when will it happen.

    Do you make cPanel backups and then simply leave them sitting on your hosting account/server? Do you make your own backups and just place them in a different folder? Well those methods are only good if you're hard drive never fails, which would be naive of you to think it cant happen to you! What if your hosting company runs off with from their data center and doesn't pay the bill? What if hard drives crash and there are no backups besides on the server? Now i'm sure you are starting to see the problem with simply backing up your data and calling it a day.

    Not only will you sleep at night after reading this, you'll also get be getting better sleep! Here is a quick tutorial to get you on your way to backing up all your data. This method is a general method, I wont show or go into detail about cPanel backups, as I personally wouldnt rely on them.

    First you must login to your server via the SSH access. Usually the same information as your FTP info. Most hosts only enable this if you ask. Its a free service! A good windows SSH program is PuTTY Download Page .

    Next lets create a folder for the database backup we're going to be performing first. Backing up the database is a important part!

    Code:
    mkdir sql
    See how simple that was, this guide is pretty much that simple the whole way through, its only this long to look impressive for the ladies. After you have your database folder created, lets enter the folder.

    Code:
    cd sql
    Boom, look at that, you've done two things, and haven't even messed up anything yet (hopefully not!). Now we're going to create a couple database backups! You may wonder why a couple backups since this is such a tried and proven method? Well todays whole lesson is about data protection, and a good policy to practice is you can never be to safe.

    For this step, you'll have to know either A. The root password (unlikely) or B. your database password (found in includes/config.php).

    Code:
    mysqldump -u accountname_user -p -h localhost accountname_databasename > databasename_date1.sql
    Repeat this process 2 more times, replace the 1 after date with 2 and 3.

    It will prompt you for your database password, if you forget or do not know, look in the config.php file!

    Look, now you have your database backups! 32.7% done!

    Next we get out of the sql folder, its good to go as they say.

    Code:
    ../
    Now you should be back into the highest level of access you have. You should see folders such as www or public_html, mail, public_ftp and so on. Your actual folders will vary!

    Lets package them up:
    Code:
    tar cvf sitename_backup1.tar *
    Boom, you should see all the files 1 by 1 flying by on the screen, that simple, all your data is backed up. So now we are at the steps that set this tutorial apart from the rest. We are going to prepare this for a off site move. The whole entire point of this long thread. If you've stopped reading by now, you youldn't be reading this anyway, so might as well keep trucking now!

    85.87% complete!

    Now you have this backup, but nothing to do with it. Some people may download their entire public_html folder via FTP, after doing this one, you'll have enough as it takes f o o o o r e v e e e e r r r. So we need to move this backup, where we can access it via the web.

    Code:
    mv sitename_backup1.tar public_html
    Now you're folder is accessible from the web, anyone can download this so do not make mention of the file name. If you place it in a folder, place a blank index.html file in there as well!

    Now we need to move this off-site. You can download it to your home computer, burn it to a couple CD's and call it a night. But thats the easy way out, but should also work for most people following this guide so far. Another way is to move this file to another hosting provider, network attached storage, or even a place that offers remote backup services.

    All you need to do is simply login to your new hosting provider via SSH and issue this one command
    Code:
    wget http://sitename.com/sitename_backup1.tar
    This will download your backup to your remote backup site.

    100% complete! I do this for all my sites once a week! Database backups are performed nightly as they are a vital part of vBulletin. You're users may return after a crash, but they are never the same or stick around long after!

    You should now be able to rest easier, and after you get good at this, it should take maybe 30minutes top to complete!



    //Source: Top vBulletin - Powered by vBulletin
    //Written by: Top vBulletin - View Profile: Dave
    //
    This tutorial may not be reproduced on other sites without a link back to vBulletin Top Site. No parts maybe reproduced, copied, stolen, screen shot // or other methods of transfe rof information. Copyright 2006 Top-vB

  2. #2
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Thanks for posting this, I've been looking for something like this for a while.

    One question,

    when you say to type this in:
    mysqldump -u accountname_user -p -h localhost accountname_databasename > databasename_date1.sql
    Should I type that in exactly or should I replace the "accountname" and stuff with my own information? and if so what should I put there?

    Sorry if this is a dumb question but I'm really trying to get this figured out and keep trying different things in that text string and nothing is working.

  3. #3
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    that is command-line mysql.
    This assumes you have root access.

    SSH into your server, and get to the mysql prompt (usually by typing in mysql) then run that command.

    and yes, replace accountname with your info

  4. #4
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Quote Originally Posted by briansol View Post
    that is command-line mysql.
    This assumes you have root access.

    SSH into your server, and get to the mysql prompt (usually by typing in mysql) then run that command.

    and yes, replace accountname with your info
    Thank you for your reply.

    I'm afraid I'm still confused though.
    In the part that says to type this in:
    mysqldump -u accountname_user -p -h localhost accountname_databasename > databasename_date1.sql
    I'm having a hard time knowing what exactly to type in.
    where it says "accountname_user" what would that be? and where it says "accountname_databasename" what would that be?

    thanks.

  5. #5
    Senior Member sportsmedjosh's Avatar
    Real Name
    Josh
    Join Date
    Jan 2007
    Posts
    404
    Liked
    0 times
    what do us mac users do?
    It may be best to not listen to anything I say for advice. :spin:

  6. #6
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Quote Originally Posted by sportsmedjosh View Post
    what do us mac users do?
    Come on, I'm being serious here.

  7. #7
    Senior Member sportsmedjosh's Avatar
    Real Name
    Josh
    Join Date
    Jan 2007
    Posts
    404
    Liked
    0 times
    I was being serious too, the link in the first post for putty was a .exe file. mac runs .dmg. But that besides the point. Is there anything wrong using the back up databases option from Vbulletin and combining that with a download of the files via FTP?
    It may be best to not listen to anything I say for advice. :spin:

  8. #8
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Quote Originally Posted by sportsmedjosh View Post
    I was being serious too, the link in the first post for putty was a .exe file. mac runs .dmg. But that besides the point. Is there anything wrong using the back up databases option from Vbulletin and combining that with a download of the files via FTP?
    Sorry then. LOL

    ya, thats what I had been wondering also. I've been trying to do a back up all day. I did a VB back up and started downloading files via FTP but I dont know how complete of a backup it is.

    I also just did a back up in my cPanel. It said "full site backup to be used when moving site to a different server" so I figured that would be a pretty complete back up. It saved the backup to the home dir and then I FTP'd it to my desktops hard drive.

  9. #9
    Senior Member sportsmedjosh's Avatar
    Real Name
    Josh
    Join Date
    Jan 2007
    Posts
    404
    Liked
    0 times
    I've been putting my backups on my laptop, external HD and an old G4 that I have in CA just in case. But now i'm also worried about how complete these back ups are.
    It may be best to not listen to anything I say for advice. :spin:

  10. #10
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Quote Originally Posted by sportsmedjosh View Post
    I've been putting my backups on my laptop, external HD and an old G4 that I have in CA just in case. But now i'm also worried about how complete these back ups are.
    Ya, My site got hacked today so I'm super paranoid. Luckily they havn't done anything yet but I dont know how they are getting in so I want to back everything up externally before they do start to make changes.

  11. #11
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    accountname_databasename
    would relate to the cpanel setup name and the mysql database


    A Mysql dump is just that--- the sql database. it is NOT a full site dump. it is only your database. you will still need to ftp your files down or some other method.

    If you have the means, i HIGHLY recommend getting a NAS on your datacenter. i have one for 20 bucks a month for 20gb.
    through WHM, i run a nightly task that runs through cpanel and does a full SERVER backup to the nas, deleting anything older than 10 days
    Last edited by briansol; 09-10-2008 at 08:29 PM.

  12. #12
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Thanks agian.

    So if I do a full server backup from cPanel then do I still need to do something like what this thread discribes? Or would a full cPanel backup be just as good if not better?

    I'd rather just do the cPanel backup since I already know how to do them and they seem to back up everything.
    They do back up everything right? If my site got hacked or the server blew up, I'd be able to restore everything to the way it was with a cPanel full backup right?

  13. #13
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    assuming you can ACCESS the back up, yes.

    that's why i suggest getting a NAS which is not on your server and is able to access it from its own IP

  14. #14
    Junior Member
    Real Name
    Josh
    Join Date
    Jul 2007
    Posts
    18
    Liked
    0 times
    Quote Originally Posted by briansol View Post
    assuming you can ACCESS the back up, yes.

    that's why i suggest getting a NAS which is not on your server and is able to access it from its own IP
    I'll definitly look into that NAS thing. That sounds good.

    As far as accessing it from my server, couldn't I just download the .rar file via FTP once it finishes backing up?
    Thats what I did last night and it seemed to work ok. The file was 500 megs though so it took about 10 min. to download. :(

  15. #15
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    you could... but its extra work, and you have to remember to do it every day....

    with it set up on your server's local network, its so much easier, and 100mbs if not a gbs link between the two makes it easy

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Development site on different url
    By GrantHorizons in forum General Discussion
    Replies: 2
    Last Post: 05-30-2006, 09:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •