When to update

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
trista13's picture

Scott and Christopher were discussing updating core on the discussion about calendar/date. I have a quick question, but wanted to separate it out as its own discussion. When do you typically do your updates? Does it depend on the site? Do you set your alarm to 2:30 am and do it then? I've been monitoring Google Analytics and it looks like Sunday night is my best bet, but I wanted to see what others do.
Thanks!

Comments

Good Question

scottrouse's picture

Thanks for bringing up this discussion separately. The time I update depends on the site: traffic, importance, size of update, etc. I try to get most of my sleeping in around the 2:30 am range, so I do few upgrades at that time. ;-) There are some sites, however, where I'd schedule an update around a slower period.

Best practices dictate that all updates (at least major ones) be run on a development or staging site that has the same configuration as the production site. That can be run whenever (i.e. - office hours) and will alert you to any problems you may encounter upgrading the live site. If that passes with no issues, you can feel fairly certain that the live update will do the same. It's a good idea to put your site in maintenance mode when updating significant code (like Drupal core).

In practice, I must admit that I do most of my site updates during the day (even though I try for first thing in the morning or last thing in the evening when traffic has slowed). Those updates, however, are performed in a way that makes it easy for me to switch back to an older codebase within a few seconds if I get a WSOD or other issue that will take some time to diagnose. If you're not to the point of using the often dreaded "command line" for manipulating your Drupal site code, it's a good learning goal to have. It will make your life much easier. Perhaps that's a good topic for an upcoming meetup.

Since the sites I have in my fold

opegasus's picture

are minor traffic sites, I do mine at my convenience. I don't have major trafficked sites (yet) so that being said...if it's a security issue, I go for the update as soon as I can. As Scott mentioned in class, once the security issue is posted, we can just bet the 'exploiters-script kiddies' will be aware of the exploits as well. So it's a time-race issue.

Scott's points about site traffic, time of day/night and day of the week are all considered 'best practices' and those same points were stressed in numerous posts as well as other classes I have attended.

Additionally, although quite time consuming, using a Dev site to try any changes is shorter in total time vs. having to reinstall the live site. We have a little time and goof luxury while working on a dev site that doesn't include a mad scramble if something goes haywire. On a live production site, there is that massive additional stress that the change has to work and if it BOLO's, bad times ahead and I can't leave the keyboard until it is fixed and fixed fast.

Plus (trying the change on a Dev site first) the UX (User Experience) stays clean and stable vs. a first time guest showing up to a messed up site. I have lot's of experience with messed up sites both as a user and in dev. Users will bounce off a site/first time visit that is poor or bad-ugly and usually never return and certainly may bad mouth that site.

Would <333 to learn command line!

trista13's picture

Seeing the magic that you and Andy can achieve with a few keystrokes is amazing! It would be great to have a meet-up where we talked about drush or command line manipulation. In the meantime, are there any books and/or websites that have a kind of crash course in this that you could recommend?

And thanks for the info about when you update. Our site doesn't have very heavy traffic, but I want to minimize the amount of people who could possibly see a site that's whacked out.

First steps

scottrouse's picture

I think command line is a good topic. It's more than just Drush. Learning how to access your web server via the "shell" (aka "SSH") and use simple commands to move, copy, and delete files and folders is a priceless skill for anyone managing a site.

There is a free 7-minute video at Drupalize.me that may be helpful in explaining the basics of connecting to your server via SSH. You'll need a program like PuTTY to be able to use the command line to access a Linux server from a Windows machine.

There are a number of "basic Linux commands" lists out there on the web, but these resources look like they may be the most helpful:

You'll want to become familiar with connecting to your server via shell and executing basic commands to copy, move, add, and delete files and folders before you get into Drush.

I'm all for a

opegasus's picture

command line meetup. it's past time for me. Thanks Scott for suggesting this.

Thanks!

trista13's picture

Thanks again Scott! There is so much info out there it is sometimes hard to find the good stuff.

I hear ya

scottrouse's picture

The hard part nowadays is not finding enough information, but rather finding out which information is useful or accurate. Preaching to the choir, I know...librarians! :-)

Along with the drupalize.me video

eporama's picture

Addison Berry (add1sun) (who made the Drupalize.me video) did a whole series of command line videos that are still available on Lullabot's main site:

http://www.lullabot.com/ideas/videos

They're listed latest first, but at least as of today, the "first" command line video is on page 2.

I've found that being at least comfortable on the command line is a great tool to have, especially if you're dealing with more than one site.

Erik

Wow

scottrouse's picture

Sure enough! Those are very cool Great resource. Thanks.

I just found the Drupalize.me video from Google, but looks like at least some of Addison's videos may be mirrored on Drupalize.me here: http://drupalize.me/videos/cat/268

A longer post

eporama's picture

I actually was asked three times in the past 20 hours about best practices for upgrading core since this is the first Drupal 6 security release in 9 months. So I wrote up a blog posting about it.

http://eporama.com/ramblings/how-i-update-drupal-core

It describes how I have set up a couple of Drupal servers to try to make updating minor versions much simpler. The basics of it can be done without drush or too much command-line finagling, but the downloading, FTP'ing, and running update.php on each site in a multisite is dramatically easier with drush.

The best part about this is that on each setup (local, dev, and production) assuming the same basic setup, upgrading from Drupal-6.20 to -6.22 can be done essentially on the fly (I tend only to set offline during updates for production sites).

Thanks

scottrouse's picture

Very helpful, Erik. I posted a quick comment/question on your blog. Look forward to your input. Also, it looked like you didn't have an RSS/ATOM feed set up for the "Ramblings" section of your site. Would love to subscribe to that in my reader if you get an RSS link online.

Thanks.

Thanks!!

trista13's picture

Thanks for the post. It was my guide through my very first update process and it led to a successful update the first try!! And, on a side note, I updated calendar and got that working too!!! I feel justified having an IPA in celebration this evening :)

Congrats!

opegasus's picture

I know how wonderful that feels...glad we could help. Have two IPA's, you have certainly earned it!

Well, if I'm perfectly

trista13's picture

Well, if I'm perfectly honest, my husband and I are sharing a growler! :)

Alrighty then...

opegasus's picture

...I won't touch that but :-D Happy Memorial Day weekend to you both. I am sure now you have a lot to celebrate.

w00t!

laken's picture

w00t!

Only local images are allowed.

Backup, backup, backup

laken's picture

Important topic, thanks for raising it Trista, and excellent tips by Scott and Christopher.

Here's the official Drupal documentation on upgrading your site: http://drupal.org/upgrade - very good information, everyone should read this first.

I will only add one thing:

BACKUP, BACKUP, BACKUP your site before you update

Database backup

Particularly when you're running updates on a live production site. Not every core or contrib module update will alter your database, but many will, and although the chances of something going wrong are usually small, it can happen, particularly if you're using bleeding-edge -dev versions of modules. In those rare situations when you update and something gets hosed in your database, you will really appreciate the peace of mind that comes from having a minutes-old backup of your site's database you can roll back to.

There are several methods to back up your database. I've listed these roughly in order from easiest to hardest:

  1. Install and use the wonderful backup and migrate module in your Drupal site. This is easy to use but also powerful, you can save DB backups to a directory on the server, an FTP location, have them sent by email, or download from the browser. Even better: you can set a regular backup schedule to take, say, daily backups automatically. Terrific peace of mind.
  2. Use phpMyAdmin (often available from your host control panel) to export your entire database, and download it to your computer.
  3. From the command line, use the drush sqldump command. This can be scheduled with cron for an alternative way to make scheduled unattended backups.
  4. Also from the command line, use the mysqldump command
  5. Also from the command line: 1,000s of other ways, take your pick.

Code backup

Since by definition bu upgrading you are replacing code on your site with new code, you should protect yourself in the rare case that the new code doesn't work, has a conflict with one of your modules, etc. So you should backup your existing code before overwriting it with the new version of Drupal you're upgrading to. Depending on how you roll (SFTP, SSH, command line) there are lots of different ways to do this (drush and unix symlinks can be very helpful here) so I'll just link to the Drupal docs page on backing up your site: http://drupal.org/node/22281)

Advanced - quick painless upgrades with instant roll-back

With a little bit of planning and command-line knowledge you can make core and module updates a quick painless experience, and be secure that you can revert both code and database changes in just a few minutes in case the upgrade goes south. I'd love to add this to the presentation on command-line skills in the near future.

You sure know how to make..

opegasus's picture

command lining sound juicy and more appealing each and every time! So command line presentations are now a must for upcoming meetups!

I can only add (and it's in the documentation, as you know) to be aware of any hacks (alterations) made to files one makes to the site and save copies of those files (ie: .htaccess | index.php | etc.) in advance in a separate directory locally (or wherever one habitually stores such files) before updating files locally (FTP-wise), and to be careful to not overwrite these on the server files unless the update needs them.

One set of directions states that some of the files do need to be overwritten sometimes (index.php for an example) so have your current settings/files available to copy in the site specific information like database access, to the new overwritten file(s).

I always (in the recent past year) make a local directory copy of the sites files (and yes a separate one for the database) and label them (inside the main site folder I use for storage-copies) something like [Site Copy 05-26-2011] and copy the site to it. So even if I goof (won't be the first time) I have a fairly rapid response to restoring the site, then I go ferret out the issues. But I can see that Andy's Do Over button (Roll-Back) would probably be much more expedient.

Thanks everyone for terrific input/links/and personal experiences shared here!

New point-release schedule

laken's picture

For Drupal core, minor point-releases (e.g. 6.2, 6.3 etc) have historically been driven by security issues. Other bugfixes or performance improvements typically needed to wait (or languish) until there was an urgent security fix that needed to be pushed out. Recently there's been a proposal to put point releases on a monthly schedule, ensuring that non-security bugfixes get released at regular intervals.

For background on this, see the discussion here: http://groups.drupal.org/node/150854

In that thread it was pointed out that UPGRADE.TXT instructions have recently been improved to better describe how to do a minor-version update, clarifying that it's a pretty quick, painless operation. So I encourage everyone (including me) to read or re-read UPGRADE.TXT.

Western Montana

Group organizers

Group notifications

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

Hot content this week