emergency backup situation - urgent help needed.

emergency backup situation - urgent help needed.

by Lev Abramov -
Number of replies: 11

Folks, who can help me out? I desperately need your help ASAP!

My site (hosted at a shared hosting) has been hacked (a security breach in an outdated installation of Mambo, nothing to do with Moodle, tocuh the wood!), and the account has been suspended. No access to anything.

Naturally, no fresh backups - and there are at least 20+ different courses buried there. My hosting provide would not let me have access to them for backup purposes. Their solution is to delete and reinstate the account, which will destroy all the files stored there.

They are willing to keep the MySQL DBs intact.

My question is whether having access to these DBs solves the problem. Is it enough to have the old DBs in order to restore the information?

If not, what else should I ask them to keep? To what extent is it critical? I can live with losing the images - I can restore them later on. I can even survive the loss of course grades. But it would be terrible to have to actually write all these courses again!..

If it is enough, how do I go about restoring these courses on a new installation of Moodle after they give me access to the new, clean-slate website?

Please help me out, as the host tech support guys are waiting for me to instruct them how to proceed, and in the meantime the courses are not running! sad

L

Average of ratings: -
In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Bryan Williams -
Lev,
You should ask your host to please retrieve your moodledata folder, which should be located outside of the public_html folder. With the moodledata folder and the database file you should be able to completly reconstruct your Moodle site.

Hope this helps!
In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Steve Hyndman -

You will need your moodledata directory. Unless you intentionally created this outside your public_html folder, it will be either at the same level as your moodle directory or inside your moodle directory....if it was an old version of Moodle, then it's probably inside your Moodle directory. With the database and the data directory, you should have everything you need to recreate your site.

Steve

In reply to Steve Hyndman

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

Thank you both for your help; I have diligently copied your responses and sent them to my host, in hope they change their decision to completely erase the site and reinstate it as a new one, without govong me a chance to backup and restore the data.

Be well, and I'll post the results as soon as the problem resolves.

Lev

In reply to Steve Hyndman

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

Dear Steve, Brian and whoever else can help:

I've been blessed with enough good luck top get my stuff back: my hosting provider's tech support guys decided to help me in my great distress smile and sent me 300MB of the stuff they rescued from the public_html folder of my shattered site. After unpacking the .tar file, I found all the sql dumps and all the zipped backup files (luckily, I had decided to configure auto backups at installation stage, so they did exist!).

Now, the downside is that there were no less than FOUR different Moodle installations. Each one had its own DB, of course. It will take a while to sort out which db corresponds to which set of backups, log files etc - but it can eventually be done.

What I would greatly appreciate is the following: I need someone to hold my hand while I restore the stuff. Someone who has been through a similar experience and/or knows what he/she is doing and what I am doing. Does this make sense? Someone who'd tell me: do this. I'd do it and respond: OK, done it; now what? - Now do that. And so on, step after step.

Maybe I don't need it at all: if I have all these backups, can I just create a new moodle installation and do Course Restore? Then why was it so important to retain the DBs?

Please instruct.

Breathlessly yours -

Lev smile

In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Steve Hyndman -

Lev,

You could do a new Moodle install and then do a course restore...that should work fine and would be the easiest. The advantage of using the original database is that you could still do a new Moodle install so that you have the latest code, but use your existing database so that you won't have to redo all your site configuration settings or restore your courses.

Here is what I would do....

1. From your backup files find the Moodle install that you were using. If there are four different ones, then they should have four different names. Open the moodle directory of the one you were using and open the config.php file. There you will be able to see the database that corresponds to that Moodle install.

2. Upload that database to your server...if you have cpanel, you can easily do that using phpmyadmin. If the database is to large to restore (if it times out) then download bigdump and follow the directions for restoring the database using it.

3. Once the database is restored, then install a new version of Moodle. Copy the config.php file from the old moodle site to your new install and copy your moodledata directory to your new site...be sure to put it in the same place in the new site as it was in the old site. If you have any custome themes, copy them to the new install.

4. Open Moodle in your webbrowser and visit moodle/admin so that any updates can be activated (see the upgrade instructions at the download section of Moodle.org).

That should do it.

In reply to Steve Hyndman

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

STEVE -

FIRST OF ALL, THANX FOR BEING THERE FOR ME. I CANNOT EVEN TELL YOU HOW IMPORTANT THIS HELP IS.

NOW, LET ME COMMENT ON WHAT YOU'VE WRITTEN JUST TO MAKE SURE I DON'T MAKE ANY MORE STUPID MISTAKES. I'LL BE USING ALLCAPS TO MAKE THIS STAND OUT NEXT TO YOUR COMMENTS.

YOU SAID:

You could do a new Moodle install and then do a course restore...that should work fine and would be the easiest. The advantage of using the original database is that you could still do a new Moodle install so that you have the latest code, but use your existing database so that you won't have to redo all your site configuration settings or restore your courses.

THIS IS EXACTLY WHAT I WAS PLANNING TO DO. THE TROUBLE AS I SEE IT IS:

I CAN RESTORE THE ORIGINAL DBs FROM THE BACKUP DUMPS (IN FAST THIS IS WHAT I AM TRYING TO DO NOW...) - BUT I HAVE A SUSPICION THAT THE MOODLE INSTALLATION PROCEDURE INCLUDES CREATING A NEW DB. IF I CONFIGURE MOODLE TO POINT AT AN EXISTING DB, WON'T IT REPLACE THE EXISTING TABLES WITH NEW EMPTY ONES?

Here is what I would do....

1. From your backup files find the Moodle install that you were using.

FOUND THEM

 If there are four different ones, then they should have four different names.

RIGHT

Open the moodle directory of the one you were using and open the config.php file.

FOUND

There you will be able to see the database that corresponds to that Moodle install.

I DO

2. Upload that database to your server...if you have cpanel, you can easily do that using phpmyadmin.

RIGHT.

 If the database is to large to restore (if it times out) then download bigdump and follow the directions for restoring the database using it.

THE LIMIT IS 51MB; THE ONE I AM TRYING TO RESTORE NOW VIA PHPMYADMIN IS ONLY 8+MB. STILL IT SEEMS TO BE TAKING FOREVER, SO MAYBE I WILL HAVE TO USE BIGDUMP.

3. Once the database is restored, then install a new version of Moodle.

DONE

Copy the config.php file from the old moodle site to your new install

THAT'S EASY

and copy your moodledata directory to your new site...be sure to put it in the same place in the new site as it was in the old site.

THAT WON'T BE EASY: THE FOLDERS ARE VERY LARGE. WILL TRY TO UPLOAD THEM A SUBFOLDER AT A TIME.

 If you have any custome themes, copy them to the new install.

I DON'T. smile

4. Open Moodle in your webbrowser and visit moodle/admin so that any updates can be activated (see the upgrade instructions at the download section of Moodle.org).

THIS, TOO, CAN PROBABLY BE SKIPPED.

OK, I'LL TRY THIS ON ONE INSTALLATION AND LET YOU KNOW.

LEV

That should do it.

In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Timothy Takemoto -
I hope that worked for you Lev.
You could also use MyDB Studio or Navicat to upload databases. I never worked out how to use big dump. In England this would sound rude.
Tim
In reply to Timothy Takemoto

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

Hi Tim! Long time no see!

Actually it hasn't worked out for me yet, due to two main reasons:

the moodledata folder is too big to upload, so it times out;

the DBs are tool large too, which causes the same thing.

I'll try the software you suggested.

thx -

Lev

In reply to Timothy Takemoto

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

Tim,

I'm having a hard time configuring Navicat to access my DB server. I'll ask my provider for help - but if you have a minute to spare + some prior experience with it, I'd greatly appreciate help.

In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Steve Hyndman -

IF I CONFIGURE MOODLE TO POINT AT AN EXISTING DB, WON'T IT REPLACE THE EXISTING TABLES WITH NEW EMPTY ONES?

No...it will recognize that you have a DB...it's just like upgrading to a new version of Moodle. When you visit moodle/admin, then it will upgrade the DB if necessary.

THE LIMIT IS 51MB; THE ONE I AM TRYING TO RESTORE NOW VIA PHPMYADMIN IS ONLY 8+MB. STILL IT SEEMS TO BE TAKING FOREVER, SO MAYBE I WILL HAVE TO USE BIGDUMP.

Yes...phpmyadmin always says the limit is 51mb, but if your database is over 2mb you will have problems. I've never used the tools others have discussed here to upload the DB, so I can't help with them, but I have used bigdump often to upload DB over 100meg. All it does is stagger the upload of the database...it works fine and is pretty easy. You just need to remember to remove bigdump like it says in the isntructions after you have completed the upload...if you don't, then someone could find the directory and write over your database. If you follow the directions in the bigdump file (just open it with a text editor and read the directions) it's pretty easy to use.

You should be able to upload your moodle/data directory via ftp even if you have to do it a few folders at a time...if you don't have a lot of users then you shouldn't have too many folders in moodledata.

Steve

 

In reply to Lev Abramov

Re: emergency backup situation - urgent help needed.

by Lev Abramov -

Folks,

who can help me with MyDB Studio or Navicat? I've downloaded and installed both in order to restore my Moodle database at the shared-hosting server, but cannot figure out how to use the locally stored sql backup to restore a remote DB.

Anyone who has done it before and can share the skill?