Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Starting over - Restoring from a backup

I don't really have a question or anything but I just felt like reporting this here as someone new might find it useful.

Last week all my websites disappeared. My web host said the drive that my information was stored on went bad and they couldn't restore any of the data. The backup of my system that I thought I had was just being backed up on the same server so when it went down, so did all my websites. It's really quite a terrible situation and it will take me a long time to rebuild 5+ years of data. I have a few files here and there and the RSS feed of my 3000+ blog posts but mostly, everything is wiped out.

I do have an old backup (June 2013) of one of my vanilla databases that I just happened to download. So, now I will attempt to restore my site using that database. I have another old database from a different forum (March 2011) but I don't have much hope that it will be too useful.

Sigh. Let the rebuilding begin.

Any advice as I go along would be welcome

Comments

  • peregrineperegrine MVP
    edited November 2013

    My web host said the drive that my information was stored on went bad

    thats unfortunate.

    In the future you might want to back up your data and files on a weekly or monthly basis and store it on your local machine.

    find a better host. I hope that not the norm these days.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Indeed. This was just one of those situations where I didn't know what I didn't know. I set up the system to back up on a regular basis & I was under the impression that the backup was separate from my main server. It wasn't.

    ugh

  • Alright, first problem encountered... I got this error after I uploaded the Vanilla files to my server.

    Fatal error: Class 'Gdn' not found in /home/

    Now, to figure out what is wrong...

  • Solved!!! (http://vanillaforums.org/discussion/21848/fatal-error-class-gdn-not-found-in)

    Simply deleted all the ini files in the cache folder and it worked.

  • LeftBrainLeftBrain ✭✭
    edited November 2013

    Alright, we're back in business.

    Unfortunately, the database from which I restored the forum was old and for some reason Discussions are not showing up. Any thoughts?

    http://thebeautybrains.com/bbforum

  • hbfhbf wiki guy? MVP

    @LeftBrain said:
    Alright, we're back in business.

    Unfortunately, the database from which I restored the forum was old and for some reason Discussions are not showing up. Any thoughts?

    http://thebeautybrains.com/bbforum

    you may need to figure out what version of the software you were running at the time and use that build, then upgrade from there. depends on what schema changes occurred between that build and the build you just installed.

  • @LeftBrain said:
    Last week all my websites disappeared. My web host said the drive that my information was stored on went bad and they couldn't restore any of the data.

    Sorry to hear that, that is pretty awful. You may want to consider a couple of measures to avoid future occurrences:

    1. Use a hosting provider with a snapshot backup system. Linode has it for their VPS, I'm sure others do too.
    2. Do daily remote backups using rsync and cron. I'd be happy to provide a couple of simple scripts if it would help.
  • peregrineperegrine MVP
    edited November 2013

    @angophora said:

    Do daily remote backups using rsync and cron. I'd be happy to provide a couple of simple scripts if it would help.

    you might post them or attach them in a zip file, I'm sure it might help a few people, if they don't know how to implement.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • angophoraangophora New
    edited November 2013

    @peregrine said:
    you might post them or attach them in a zip file, I'm sure it might help a few people, if they don't know how to implement.

    Sure. Assume the directory structure is

    /home/myacct/domains/
                         domain1.com/
                             backups/
                             logs/
                             public_html/
                             scripts/
                             ...
                         domain2.com/
                         ...
    

    This script generates a database dump:

    #!/bin/sh
    domain='domain1.com'
    dbname='domain1'
    dbuser='domain1dbuser'
    dbpass='domain1dbpass'
    
    /usr/bin/mysqldump \
        --opt \
        --user=$dbuser --password=$dbpass \
        $dbname \
        | bzip2 \
    
    
      ${HOME}/domains/${domain}/backups/${dbname}-date "+%Y-%m-%d".sql.bz2
    
    
     
    find ${HOME}/domains/${domain}/backups/ -type f -name "${dbname}-*.sql.bz2" -mtime +14 -delete

    The reason for the variables in lines 2-5 is because I copy the script for every new domain and this makes it easier to not make a mistake. Lines 7-12 generate a compressed database dump. Line 14 deletes dumps older than 14 days. For large databases, I reduce this number.

    This script copies the whole directory to the remote server, except for the mysql directory:

    #!/bin/sh
    #
    remoteserver='username@remoteserver.remotedomain.com'
    remotebase='domainbackups'
    domain='domain1.com'
    
    localpath=${HOME}/domains/${domain}
    remotepath=${remotebase}/${domain}
    /usr/bin/rsync -rtz --exclude '.nodelete' --exclude 'homes/mysql' --links --delete $localpath/ ${remoteserver}:${remotepath}

    These two scripts need to be executed by cron. I use crontab -e but you may have a control panel that allows you to set up cron jobs. crontab -l should include lines something like:

    15  6 * * * /bin/sh /home/myacct/domains/domain1.com/scripts/backup.sh
    15  7 * * * /bin/sh /home/myacct/domains/domain1.com/scripts/remote.sh
    

    The weakness of this method is that if, say, files get deleted from your site, then they will be removed from the remote backup next time the script runs (and possibly before you realize that something is wrong). You could make the script more complicated and have alternating or even rotating remote backups. I use my hosting provider's ability to make daily snapshots of my whole server i.e. I use both methods I suggested above.

    Hope this is helpful.

  • Great information! Unfortunately, I don't know enough about programming to know what specifically to do with a script. Like, how would I make it work?

  • @LeftBrain said:
    Great information! Unfortunately, I don't know enough about programming to know what specifically to do with a script. Like, how would I make it work?

    Hi there. Well, you would put it into your cron table as described above, so that the server executes it automatically every day and runs backups. You can also run a script (e.g. for testing) by typing something like:

    sh ~/domains/domain1.com/scripts/backup.sh
    

    However, this does assume ability to use a shell. Do you have shell access to your site? You also need a remote server, rsync.net is a good dedicated remote backup option (I think so).

    Perhaps the first option that I suggested would be the best approach: look for a hosting provider that provides daily snapshot backups of your site. You may need to pay extra for it but (I think you will agree) it's worth it.

    :)

  • Yeah, I think the paid host backup option (with weekly auto database backups) would be easiest.

  • LeftBrainLeftBrain ✭✭
    edited November 2013

    Ok, for those of you following along, I ran into my first problem. When I enabled BotStop and Registration Restriction plugins and switched from "Basic" to "Approve" in the application process, I got a bonk.

    That was a problem with BotStop which was fixed right here.

    http://vanillaforums.org/discussion/comment/167592/#Comment_167592

    Oh yes, the forum I'm trying to restore is http://chemistscorner.com/cosmeticsciencetalk

  • Alright, I've restarted another of forums. http://chemistscorner.com

    The first problem that I ran into was when I switched on the application process to "Approval" instead of "Basic". I remember I had this problem once before. Now will have to search for how I resolved it.

  • Alright, I've restarted another of forums. http://chemistscorner.com

    The first problem that I ran into was when I switched on the application process to "Approval" instead of "Basic". I remember I had this problem once before. Now will have to search for how I resolved it.

Sign In or Register to comment.