/drupal directory deleted

Events happening in the community are now at Drupal community events on www.drupal.org.
caelon's picture

I'm about to throw up. I was trying to set up a user to have FTP access to the drupal directory to help out with some sites. I mounted the drupal directory to a subdir under his home dir. I was trying to start over and deleted his directory. Of course, I went to delete the drupal reference in his directory so I could delete his dir. Obviously, the wrong thing to do - it wiped out my whole drupal dir.

The VPS provider I have offered backups as a beta and I went with those. They were working a few months ago and I never checked them again. I went to check them - it's been disabled for a few weeks as they were not reliable. It's ext3, so I don't believe the directory is recoverable, at least, not to my middling level of unix knowledge.

So, I've deleted my drupal directory and have no backup. Fortunately, all the databases are fine as that contains all the stuff I would never be able to recreate. However, my brain is completely scrambled at the moment. What's the best way to restore the drupal directory for multi-site usage? I can untar the drupal version I was using and find all the themes I was using. I guess I'm trying to think through how to link all the databases - once that's done, I think it should pick up the sites and go but, like I said, my brain's a bit of mush right now because of my idiocy.

Comments

First, take a backup

garethsprice's picture

Firstly, EXPORT A SNAPSHOT of each site's database, so you can always revert to the one you had.

Create folders under /sites for each site you want to create (possibly start with one, just to make sure it's working).

Unpack and put in as many modules and themes as you can remember having dependencies for, in the same location as you had them before (ie. sites/all or sites/foo). Drush is helpful for downloading and extracting many modules.

Create an EMPTY database for each site and set up the settings.php file to point to the empty db.

Run Drupal's install.php for each site, creating a base Drupal install for each one.

Import each site's snapshot into it's new, empty database.

Empty cache, see if everything is working. Especially check modules and themes - Drupal's not very good at recognizing when a module has disappeared - the data will still be there but there won't be any mention of it on the front-end, other than that part of the site not working.

Rebuild the custom modules and themes you were using.

Test, test and test again to make sure you haven't forgotten anything.

Take more backups in the future :) Even if your host doesn't offer them automatically, you can set up a shell script that'll take snapshots of your databases, tar the whole thing up with your Drupal folder and dump it into a folder outside of your web root.

Hope this helps...

Orlando, FL Web Developer | http://www.garethsprice.com/

Oh, if you want to skip a

garethsprice's picture

Oh, if you want to skip a step, you can just edit settings.php of each new site to point the old database. I prefer the idea of keeping the old one around intact at first, though.

Orlando, FL Web Developer | http://www.garethsprice.com/

Thanks, this is a big help.

caelon's picture

Thanks, this is a big help. One thing I think I can do is use the system table to find the modules and themes I had installed and enabled. That should help the process some.

Don VanDemark
Agile Process Manager, Blue Shield of California

Good thinking :) Good luck!

garethsprice's picture

Good thinking :) Good luck!

Orlando, FL Web Developer | http://www.garethsprice.com/

I'm about 95% back up. Thanks

caelon's picture

I'm about 95% back up. Thanks again, Gareth. I probably would have gotten there on my own eventually but having someone else lay out the steps reinforced the right steps.

I owe you a drink next time we're at an Orlando event together.

Don VanDemark
Agile Process Manager, Blue Shield of California

Florida

Group organizers

Group categories

Florida Topics

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week