Hi,

I am totally new to Drupal. Been using Mambo, Joomla for 4 years now, but I am trying out Drupal as I am getting sick of Joomla :P

Question though, is it possible to apply updates to Drupal from the back-end? I see that I have an update 7.11-7.12, but do I really need to:

1. Download New version
2. Delete all files and folder EXCEPT, the "sites" dir, the "profile" that the site was installed with, my theme, and other customized files
3. Upload entirely new package and extract
4. Put all my custom and og files back
5. Then run update.php

? Seems like a lot of steps to preform minor update. Just want to make sure I am doing this right....

Thanks

Red

Comments

Jaypan’s picture

You don't have to delete any files. Just unpack the zipped file into the webroot, overwriting the current file-system. Then run update.php and you're good as gold.

Test on a non-live site first in case it crashes your site. And make sure to take both database and file-system backups before starting.

Web Assistant’s picture

I'd really suggest removing the files first rather than overwriting, or you might be left with stray files.

http://api.drupal.org/api/drupal/UPGRADE.txt

Jaypan’s picture

While it's very true that you could be left with extra files, I've done hundreds of updates, and never once bothered deleting all the old files, I just unpack overtop the old files. It's much much faster, and a couple of stray files aren't going to take up any space on the server worth worrying about.

Web Assistant’s picture

You keep going on about best working practices and you say this.

Look at it a different way - if I hire a new developer in my company, then give them some code I've written to fix, they are going to go looking in certain places to find where it's happening. Now if they find a whole load of stray files from years of Drupal updates, they are going to be very confused. Now, most programmers who know their way around Drupal will probably figure this out quick enough, but they shouldn't have to.

The instructions are very clear:

3. Remove all old core files and directories, except for the 'sites' directory and any custom files you added elsewhere.

Jaypan’s picture

Fair enough. If you want to remove all the old core files first, you are more than welcome to. For me, I'm happy to unpack overtop the old files, and do a database update. When I upgrade version (5->6 or 6->7), I clear out the entire core files and put in a fresh copy. But I've never felt the need to do so when upgrading within a version of Drupal, and in the dozens/hundreds/thousands of times I've upgraded core (I really have no clue how many times, but it's been a lot), I've never had a single error come up from it.

That said, there is always the possibility of lingering files. For example, I got left with a bunch of translation files when the translation system switched to being based on the Drupal servers. These definitely were unnecessary files, and for someone who doesn't want any unnecessary files on their system, they aren't going to like my method of doing it, and should most definitely delete all the core files before unpacking the new updated file system.

Web Assistant’s picture

I really find this shocking, not only are you going against best Drupal practice, but you are actually defending it. This after giving me a long lecture that I should always be sticking to best Drupal practice.

What if a Drupal coder found some code that they wanted to include in their module, then it turns out to be from a stray file and that module no longer works on a new Drupal site, or when the site has then been updated using Drush.

http://www.merriam-webster.com/dictionary/hypocrite

I agree, if you want to do this then that's your choice, but why are you telling other people to do it?

Jaypan’s picture

Because in my experience, it's unnecessary and not worth the additional time it takes to do it. You brought up a very good point, and backed it up, that it is recommended that people remove all the core files before unpacking the new ones. This is kost definitely the way it *should* be done, And if people don't feel comfortable with my method, then they should most definitely ignore it and do what they feel most comfortable with.

Web Assistant’s picture

The problem is Jay, you are a very experienced Drupaler, so anyone new will listen to you. In that case, do you think it's fair to tell them to do something that is not best Drupal practice? Not everyone will have the knowledge to know whether or not to ignore this advice.

Standards are there for a reason! :)

Jaypan’s picture

In this case, I was not aware that removing all files was best practice. That said, I will still continue doing it the way i have described myself, as it's not worth the effort to delete all the files first. If it makes you happy, I strongly recommend that people don't follow my example, as any issues that msy possibly arise from doing so will be your own responsibility for following my incorrect advice.

As for being an experienced Drupaler - I'm a hack the same as most people here. I have no post count, so no one should think I'm anything more than a username, same as anyone else.

Web Assistant’s picture

I find it hard to believe a Drupal master such as yourself has not read the upgrade instructions. But fair enough, if you actually thought it was the Drupal way to just overwrite over old files then I apologise for any distress I may have caused by pulling you up on this.

It's interesting though how you say you will continue to go against best Drupal practices.

I heard a quote today, I think it's relevant...

I remember one time, having a discussion with my friend. I was annoyed about how someone else we knew had been fighting so hard to prove a point even when they were totally in the wrong. I said that I had a hard time understanding how someone could argue a point even when they knew they were wrong, and my friend said something to me that stuck with me from then until now. "When I know I'm wrong about something, I'll argue even harder, because I hate to be pointed out how I'm wrong."

Jaypan’s picture

The upgrade instructions I read when I read them just said to do it the way I've done it since I read that, and it's never caused me an issue. As a business owner, and a guy who has 20 or so sites to upgrade each time a new version comes out, I'm not going to go with the best practices when in my not small experience, the method I learned leads to no errors. I don't recommend others follow my lead, but in order to maximize my own output, I'll continue using my method.

Web Assistant’s picture

I'm not trying to be argumentative, it's just you know much more than me so I'm trying to get my head around the best ways to do things.

So I'm curious, why don't you just use Drush?

Also, the upgrade instructions as far as Drupal 4 say to remove files first.

Jaypan’s picture

I do use drush, but not for core updates. It overwrites my .htaccess forcing me to have to re-edit it each time I upgrade. I can still upgrade core through the command line, it just takes a few more lines.

Web Assistant’s picture

That's interesting. I just SFTP a copy of the .htaccess file after the update, I also run a custom command similar to Drush Cleanup to remove all those unwanted files.

I just have the feeling in my bones that overwriting is wrong, and have read in many places not to do so. But as you say, whatever works right? Like in my other post?

Jaypan’s picture

You are using a different system than me altogether anyways. I have the whole thing set up on a GIT repository, and I'm never directly touching any of the code on my servers, and/or using (S)FTP.

As well, I don't agree with the 'whatever works' method - if I did, I would have been hacking core a long time ago, which most definitely works, and is wrong. Which is also why I disagreed with your method in the post you have linked to. As I stated in the other post, what you did would work, but wasn't a good idea. I also stated why it wasn't a good idea.

In this circumstance, I have enough experience to know that I feel confident in doing this in my manner, with the experience to show me that doing so leads to no consequences and/or conflicts. I wouldn't make that same decision if it was a situation in which I felt by doing it using my method I would run into conflicts in my code, or run into problems with developers that were expecting to see things done one way, and have them done differently.

So essentially, you are comparing the example you linked to, an apple, with this thread, an orange.

Web Assistant’s picture

Though I'm puzzled, you stated in the other post that the solution works, and wouldn't cause any problems (such as throwing errors etc). Yes it might confuse other developers, but so would stray files all over the place. The fact you are using GIT tells me you code with other people, which in my mind makes it even worse if they happen to come across a stray file in a module and start including bits of code from it.

So in fact, in this case, an apple is just an apple.

You really are proving my point, it's seems to be one case for you but another for others. Just because your very experienced it doesn't mean you should go against best Drupal practices. But not even that, actively telling other people to do it, wow!!

But perhaps you're right and I'm wrong. Maybe I *know* I'm wrong and just arguing harder because of it, like you alluded to in the other post. So anyone reading this, ignore the Drupal docs because Jay says it's OK.

Jaypan’s picture

But not even that, actively telling other people to do it, wow!!

You seem to be ignoring this comment by me:

I strongly recommend that people don't follow my example, as any issues that msy possibly arise from doing so will be your own responsibility for following my incorrect advice.

I'll also add, your whole problem with me stems from the fact that I pointed out where you were wrong in the other thread, and you didn't like it. You pointed out where I was wrong in this thread, I even agreed with you that I was wrong, and actively recommended that people do not follow my advice, as it's wrong. And yet you are still picking at me... Let's compare this to the other thread - I pointed out you were wrong, and you have been fighting tooth an nail about how I'm a hypocrite... all the while ignoring the fact that you were wrong.

Web Assistant’s picture

I think you have a problem backing down when you are wrong, in this thread you clearly are. In future, when you're giving advice to people, especially people that are new to Drupal, you should check first to see the advice you're giving is correct. That's all I need to say on this.

Jaypan’s picture

I think you have a problem backing down when you are wrong.

By backing down, I'm guessing you mean the person should admit they are incorrect, pointing out that people shouldn't follow their incorrect behavior, and clearly stating what the proper behavior would be? Is that a fair assessment of what 'backing down when wrong' involves?

Quote me:

You brought up a very good point, and backed it up, that it is recommended that people remove all the core files before unpacking the new ones. This is kost [ed: typo - supposed to be 'most'] definitely the way it *should* be done

Quote me again:

I strongly recommend that people don't follow my example, as any issues that msy possibly arise from doing so will be your own responsibility for following my incorrect advice.

Reading those two posts quotes, it most definitely seems like that I have a very, very serious problem with not being able to back down when I am incorrect.

In future, when you're giving advice to people, especially people that are new to Drupal, you should check first to see the advice you're giving is correct.

1) Are you going to do this yourself then as well?
2) If I checked everything before I posted it, I'd not have enough time to post.
3) I'm right most of the time, but sometimes, such as in this thread, I'm not. I don't mind admitting it, but I'm not going to stop giving help out of the fear that I may give incorrect help occasionally. When I give advice, it comes from the years of experience that I have, combined with the knowledge of the system that I have. Was my advice technically incorrect in this thread? Yes. Was it harmful? I'd say no. I've been operating under this mistake since I started using Drupal (I have never once deleted core files before updating them for a system update), and it has not yet ever caused me issues. If I were to follow your advice, and check everything before I posted it (which would mean I'd be posting a lot less), I'd be not helping a lot of people out of the fear that I may be incorrect on some occasions.

Now, if I ignore your advice, the following happens:
1) Someone asks a question
2) I give an answer.
3) When I'm wrong, someone else can come in and say 'no, that's wrong, it should be done this way'

With this method, we all collaborate - everyone can give info, and incorrect info can be corrected. With your method, everyone spends half their time being afraid of making a mistake, therefore preventing them from posting the other half the time.

I live in a country where people are so afraid to make mistakes, they have an inability to act. They freeze. It's a huge problem here, and in all honesty, I'd rather be wrong sometimes than just not act at all.

Web Assistant’s picture

Wow, you seem to have a lot to say for someone that doesn't like to argue back when they know they are wrong. It's simple, it says in the docs you should delete files first, you don't do this and it's the wrong way! All your other excuses and talk isn't going to change the fact.

Jaypan’s picture

And I have agreed with you! People most definitely shouldn't do it my way, and if they choose to do it my way, and have unexpected consequences, it will be entirely their own fault!

Web Assistant’s picture

Thank you.

Jaypan’s picture

I'm still going to do it my way though.

Web Assistant’s picture

lol, you're sooo stubborn! I kinda like that though.

clicktracking’s picture

I agree with you jay :) I will do the same thing too. Thinking of this will help organize of what I have using and for what I do not used for. But at the same still have the copy of the files that I am not using so if ever that I have something need to it I can look back and get it anytime. Looking forward for more info.
Thanks
Click Tracking

Web Assistant’s picture

@clicktracking Although I don't fully agree with Jay, I do understand his argument here. But what you say makes no sense to me at all. I find it interesting you've been a member for only 2 hours. Dare I suggest Spam?

Web Assistant’s picture

It used to take me forever to do updates. I spent a little time learning how to update Drupal using Drush from the command line and now it takes me a few minutes with hardly any effort. Just a suggestion, if you already know your way around the command line that is.

Jaypan’s picture

Yeah, between Git and Drush, I can update about 10 installations in 10 minutes. It's pretty quick.