Disaster - lost CSS files!

mk31762 - June 19, 2009 - 16:21

I was trying to consolidate all of my image files. I had files everywhere. So, I changed the File System path from /sites/default/sitename to sites/all/themes/sitename to force all image uploads to go into a folder in my theme directory. I also copied some files I had in the folder configured for WebFM.

Things were going pretty well until I cleared the cache. I got a permissions warning about the CSS files. To my horror, I discovered that my CSS files are gone. There was a hell of a lot of work in there. Sadly, my most recent backup is about 2 weeks old.

Can anyone explain what happened here? I take full responsibility for my failure to have a good backup. Still, whatever happened, that's a very serious side effect!

=-=

VeryMisunderstood - June 19, 2009 - 16:25

were you using css aggregation? if so, it must be disabled before hand.

if css aggregation is still enabled, you should disable it and reenable to see if it will pick up the moved folder.

Though I wouldn't have moved the files folder where you have. I don't understand the difference between sites/default/files and sites/all/themes/sitename

schadenfreude

dman - June 19, 2009 - 16:36

That's weird X 2
Weird what you did with the files directory ... but weirder still that any unknown files were deleted.
I don't know of any code anywhere in the system that would intentionally delete theme files ... unless ... OMG.

O_O

You overlapped your themes/themename/css/ directory with the sitename/files/css/ temp path!

OK. Sorry, but that's funny!

Your files/ directory has a special, dedicated files/css folder. In there go hash-named autogenerated versions of the cached, compressed css.
Periodically, drupal can delete everything in that dir. It doesn't keep a record of the hashed names, and it bears total ownership of that volatile dir. You managed to point that dir at your theme css folder.

Um. Best advice is: Don't do that again!

:-{

.dan.

It's all right. It's kind of

mk31762 - June 19, 2009 - 16:55

It's all right. It's kind of like I stumbled upon that exact combination of settings to lead to a disaster. The product of bad luck and inexperience, I suppose. Although, maybe there should be a warning on the File System admin page in big red letters saying CAUTION: THE WORLD MAY COME TO AN END IF YOU DON'T KNOW WHAT YOU'RE DOING HERE!!!

Incidentally, there is nothing wrong with sites/default/sitename, I just happened to have some image files in the theme folder to begin with. I wish I would have selected sites/default/sitename. I could have gone either way.

a warning...

dman - June 20, 2009 - 01:27

Well, it did say

Changing this location will modify all download paths and may cause unexpected problems on an existing site.

but it wasn't exactly alarmist enough to guess that you'd manage to do exactly what you did ...
Congratulations, you're special!

.dan.

 
 

Drupal is a registered trademark of Dries Buytaert.