Welcome to OMG boards community!
Community of friends where we talk about daily life, offtopic stuff, and what keeps us busy.

You are currently viewing our community forums as a guest user. Sign up or
Having an account grants you additional privileges, such as creating and participating in discussions.

The "official" Backup Thread!

Discussion in 'Manage your Site' started by vB4Guy, Nov 30, 2009.

  1. vB4Guy

    vB4Guy OMG Member

    Threads:
    4
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    40
    The "official" Backup Thread!

    I see it time and time again, like here: http://vbfans.com/showthread.php?t=55990 where a site owner puts sweat and tears into building a community and then seeing it hacked. And it's not just that. A hosting provider could go bankrupt, an upset administrator could mass delete content. Name it, all sorts of things.

    So why not build a nice resource for those who need help backing up.
    Because with a good backup setup one could just take a backup, go to a new host, restore the backup and continue the site - all within hours.

    Step 1: Always back your site up. This includes files and the database. And documentation with details of accounts and what not. We can use this thread to give our hints and tips, scripts and resources, to provide the best approach to how to backup, how to restore, and other best practices.

    Step 2: Own what is yours. Be in control of the domain name and the hosting account. If you can host with say namecheap and change the IN A records, regardless which provider you use. You can switch provider within the hour, hardly any downtime. And if you are in control of your hosting account you can make proper backups and restore them as needed. Without running into inconvenient hosting account limits.

    Step 3: Double check everything. Making a backup of a corrupt database, will not help, if you do not have a rollover solution. Running a daily script is nice, but you have to check if the results actually work. Do a test restore on another hosting account to find potential issues.

    Step 4: Ask for help where needed. Don't be shy. Contact your hosting provider, your tech-friends, the forum support team, etc, for help. Post in this thread, or this forum if you have questions. The best way to avoid mistakes is to learn and understand the changes you're making to your sites.

    Share your ideas, tips, code, resources, and backup approaches, solutions, etc. Let's help eachother out.
     
  2. Floris

    Floris I'm just me :) Hi. Staff Member

    Threads:
    10,386
    Messages:
    36,946
    Likes Received:
    587
    Trophy Points:
    855
    Gender:
    Male
    Very nice idea, here are a few tips:

    How to backup: (recommended: CLI .sql.tar.gz dumps)
    http://www.vBulletin.com/go/backup

    How to restore: (recommended: CLI mysql import)
    http://www.vBulletin.com/go/restore

    Power your site with a LAMP solution, linux operating system, apache/php and MySQL database. In my experience managing a site on linux is so much easier than on Windows. The backups have never failed me (so far).

    Get a VPS or Dedicated server for your site, don't go with shared hosting. I've written a blog entry here about why I think that: http://mrfloris.com/blogs/why-shared-hosting-is-history-upgrade-to-vps/

    Don't use GoDaddy for hosting or domain registration, use NameCheap for domain registration. And use a respectable hosting provider.

    I agree, be in control of your domain and your hosting account. Get shell access on at least a VPS and take your backups serious.

    vBulletin has a vb_backup.sh shell script you could customize to your needs and put in a daily crontab. I have customized mine to make daily backups, and use a timestamp, and delete everything older than 7 days.

    Another two tips:

    Update your LAMP setup frequently, fixing known bugs and security issues. The same goes for your forum software and your plugins. This saves getting hacked, or get corrupted data.

    And optimize/repair your database when needed, say once a quarter, or even monthly. Avoiding database corruption and loss of data.

    Keep your software and forum secure.
     
  3. Freedom

    Freedom OMG Member

    Threads:
    332
    Messages:
    716
    Likes Received:
    0
    Trophy Points:
    125
    I saw someone mention crontab, I find it so annoying to use vi or iv or whatever. I always type:


    export EDITOR=pico

    before I do crontab -e

    This way I can just use pico to edit the crontab entry, upon control+x (save/exit) it will say 'installing new crontab'

    A lot easier, for me at least.
     
  4. Freedom

    Freedom OMG Member

    Threads:
    332
    Messages:
    716
    Likes Received:
    0
    Trophy Points:
    125
    [noparse]
    Oh, and I got Floris's vb_backup.sh script, which is customized (though very outdated version), he has:


    date=`date "+%d-%m-%y-%H%M"`
    database="${dbname}-${date}.sql"

    And then the mysqldump ends with > /backup/${database}

    And you can do find first, to see which /backup/*.sql.tgz entries are older than X day, and rm them.

    delete_older="4"
    find $path_to_backups -name ${dbname}*.sql.gz -type f -mtime +${delete_older} -exec rm {} \;


    I hope those who know bash/perl/etc understand this enough to use it. Enjoy!

    [/noparse]
     
  5. Floris

    Floris I'm just me :) Hi. Staff Member

    Threads:
    10,386
    Messages:
    36,946
    Likes Received:
    587
    Trophy Points:
    855
    Gender:
    Male
    I read the latest version of that file that I have, but it says in the header it's copyright Jelsoft and can't be distributed. I would have to write find/replace or find/add instructions. I will see what I can do.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice