How To

How to avoid nightmares when upgrading your Drupal install

I had some real “fun” today (about a full day’s worth) after upgrading one of my Drupal installs from 7.7 to 7.8. The whole site went awry: the template no longer showed, I was only getting text, I kept getting either 404 or 500 errors when clicking on links, and nothing I did seemed to make it better. Even restoring from a backup yielded the same garbled pages. It’s fixed now and working perfectly (well, not perfectly, because some modules are still in beta and there will always be some errors, but it’s working as expected, let’s put it that way).

If you’re only here because your site is garbled after an upgrade, let me save you some time. There are two reasons (I know of ) for it:

  1. You have Clean URLs enabled and your .htaccess file got replaced. That means the RewriteBase rule is now commented out. Don’t bother to turn off Clean URLs, there’s no need to do that. Uncomment it, refresh your site and links should be working properly.
  2. If your theme is now messed up and you only see text, plus you can’t navigate around your site, you have your site cache and compression turned on, don’t you? Yeah you do, and now the new version of Drupal doesn’t know how to read the cache files, because it didn’t write them. So do yourself a favor and turn the cache files off. You’ll have to use the “dirty” URLs if you can’t navigate to the admin panel, so instead of example.com/admin you’ll need to type example.com/?q=admin, and so on and so forth. Disable the compression and the cache, and delete all the cache files. Presto-change-o, your site now looks normal again!

So, what can you do to avoid having the same crappy day I did? Let’s take it by the numbers, shall we?

1. Put your site in maintenance mode.

2. Always, always back up your site and your database before doing a core upgrade.

I would recommend doing a backup even before upgrading modules. Don’t rely on backup modules. Do the backups manually, and just so you won’t panic when something goes wrong, test your backup method by restoring from it to a separate install, to make sure you’re doing the right things. This is especially important for database backups, where it’s REALLY important for you to be able to restore from a downloaded SQL file.

Before doing the core upgrade, do a full backup of the entire site, not just the sites folder. And just to make it easier for you to restore the sites folder afterward, do a separate backup of that folder, and of the .htaccess file at the root level of your drupal install. And back up the database, that’s really important! If you do this right, you’ll only need to use the database backup.

3. Turn off all site caching and compression and clear the site cache. This is really important! If you don’t do this, it’s quite likely that your site will be just as garbled as mine after the core upgrade.

4. Create a new site folder on your server, because you’re going to do a brand new install of Drupal (whatever the latest version is). Inside that folder, wget the latest drupal tar.gz file and untar it.

Okay, now comes the fun part.

5. Delete the sites folder in the new Drupal install and copy over your old sites folder.

6. Make sure any changes done to your .htaccess and robots.txt file are reflected in their counterparts in the new Drupal install. Or, it’s quite likely that the old thing that you need to change in the .htaccess file is to uncomment the Rewrite Base line. Find it and uncomment it.

If you don’t uncomment this line and you have Clean URLs enabled, your site will either give you 404 or 500 errors when you try to access the admin interface or alias URLs, so this is quite an important step!

7. Restore your database from the SQL backup. That is, create a new database on your server and through the web interface or through SSH, restore your database backup to it, to get an exact copy of your live Drupal database.

8. Now run the database update script. Browse over to your Drupal install + /update.php and run it to make sure the database upgrade is also completed.

9. Now you have some choices to make. Once you do this, you have two working installs of Drupal: the old, reliable install, which you’ve been using, and the new install, which should be working, but who knows what bugs there might be in the code, that you’ll only discover as you begin working with it.

So now you have two choices: you can either map your domain to the new directory or rename the old directory then rename the new directory to match the old. In other words, you’ll want your domain to point to the new Drupal install. Or, you have the luxury of saying “Forget this new version for now!” and keep using your old Drupal install, until they work out all the bugs (that’ll be the day…)

That’s it! Pat yourself on the back. This should have taken about 15 minutes or less, not a whole day…

I hope this has been helpful!

Standard
How To, Reviews

How to watch Netflix from abroad

At the start of 2009, when I left the US to spend most of the year abroad, I was an avid Netflix subscriber, and I looked forward to being one even as I lived abroad. There was a loophole in the Netflix protocols which allowed my wife and I to watch movies from outside the US (see this post), but they plugged it very quickly — within three days after I wrote about it.

I was, needless to say, very disappointed. Here I was, a US citizen, with a US mailing address, a US bank account and a US credit card, wanting to watch movies legally instead of downloading them from torrent websites, not able to do it, just because my IP address happened to be from another country. This was not fair. I cancelled my subscription. In hindsight, my anger was unnecessary. The situation is probably a result of certain stipulations in their contracts with the movie studios.

Still, there’s obviously a need for a legal way to watch movies online, right? And until Netflix (or another company) decides to open up their servers to paying customers from all over the world (which I hear might happen), here’s how to watch Netflix from abroad, right now.

You’ll need:

  1. A US credit card and a US mailing address. If you’re from the US but you happen to be abroad, great, you’re in luck, because you probably still have both of these. If you’re not from the US, see if you can make some arrangements with friends in the US.
  2. A VPN connection that will give you a US IP address, or a DNS Proxy Service subscription which will make Netflix and other US streaming sites think you’re based in the US. 
  3. A computer that’s compatible with Netflix Streaming. At this time, I believe only Mac and Windows computers can do it. The last time I tried it, a Linux machine wasn’t compatible. You could get a Netflix-compatible device or media appliance but if you want to keep things simple, stick with a computer.

That’s all you’ll need.

The DNS Proxy Service is a fairly new offering and is, in my opinion, the easiest way to configure your device to watch Netflix from abroad, without installing any additional software or configuring a custom VPN connection. You simply change the DNS servers for your network card (see these instructions).

Now let me talk a bit about the VPN service. In the two years I’ve spent abroad, I’ve used two services: AceVPN and HideMyNet. I’m currently using HideMyNet for my VPN service, and I’ve been using them for the past four months. Both cost about the same, but from my experience, HideMyNet has faster, more reliable service.

I started out with AceVPN but after several months, I started getting a lot of buffering messages when watching Netflix (you know, where you wait for it to load up the movie). It would take minutes, sometimes 5-10 minutes to load up a movie, and toward the end of my subscription with them, the movie would stop playing multiple times as we watched it, and we had to wait for it to rebuffer. It was annoying, particularly when the movie stopped playing during a gripping scene. Who knows, perhaps they were experiencing growing pains or temporary issues with their servers…

Out of the blue, the folks from HideMyNet contacted me to see if I wanted to try their service and write about it. Disclaimer: they offered me a 1-year subscription to give an honest opinion about their service. I told them I would, but that I’d need to try out their service thoroughly before I spoke about it, and if I found anything negative, I was going to reveal that as well. That was back in April of this year. It’s now August, four months later, and after all this time, I can definitely recommend them.

I do have a few pieces of advice for you:

  • If you’re not sure how to set up a VPN connection as L2TP or PPTP on your Mac, go with OpenVPN and Tunnelblick. Check out their setup instructions for the details. If you’re on Windows, setting up an L2TP connection is super easy and takes only a few minutes.
  • Make sure to ask their Tech Support which of their servers would be faster for you. Here’s some general advice I got from them on this issue: “Generally you want to connect to whichever server is closest to you [geographically]. If you’re in the EU you should try our DC and NYC servers. If you’re in Asia you should try the Seattle or LA servers. If you’re in South America you should try the Dallas and LA servers.” 
  • They currently have a limit of two simultaneously connected devices, so keep that in mind. I believe Netflix has the same limit, but if you were, for example, watching Netflix on one computer and browsing the internet on another, both through their VPN service, you wouldn’t be able to, for example, connect a third device (computer or phone) through the VPN service until you disconnected one of other two.

So there you have it. That’s how you can watch Netflix from abroad. It’s simple, it’s easy and it’s legal.

On a side note, I can’t understand why movie studios prefer to hang on to costly and outdated ways of distributing content, and thus encourage piracy, instead of promoting lower-cost, easily available methods of renting or purchasing their content, for any customer, anywhere. There are many people who would rather pay than use torrents, but the cost is either too high, or there’s no way to pay even if they wanted to. Thank goodness for VPN technology, otherwise I’d start thinking about using the torrents as well.

Standard
How To

Quilling – The Art of Paper Filigree – Episode 2

In this episode, you will learn how to put together various design elements in order to create a veritable paper filigree (quilling) greeting card. It uses techniques taught in the first episode, plus it introduces some new ones. You’ll really like the result!

English subtitles available directly on YouTube. Click on the video itself to be taken to its page on YouTube, where you’ll be able to turn on/off the subtitles using the CC button.

Episode QARH-002-RO-HD
Released 2/25/11

Standard
How To

Do you want to learn quilling?

In addition to Ligia’s Kitchen, we’ve just launched a new show today called Quilling – Arta de a Rula Hartia (The Art of Paper Filigree), with my wife as the host and me as the producer (and everything else inbetween).

The show is in Romanian, but we’ve got English subtitles for all you wonderful English speakers out there. And of course we’re filming in HD, so you can see all the little intricacies of the art, as my wife demonstrates them for you.

This won’t be a weekly show — we’re thinking something along the lines of monthly or sometimes twice a month — but we’ll do our best to make it a more or less regular show.

Stay tuned, I plan to launch a show of my own as soon as I can dig myself out from under all this work I’ve made for myself…

Enjoy!

Standard
How To

Custom-built bathroom shelves

This summer, I built a few custom shelves for our bathroom, and only now got around to writing about them.

There’s a certain quality, a character, to objects made by hand, that you just won’t find in mass-produced items. There’s also the fact that if you make something yourself, to the exact measurements of the place where you want to put it, you won’t be able to find a better fit anywhere else, no matter how many stores you visit. And there’s also the little matter of money — chances are, it’ll cost more to buy it than it will to make it yourself.

In my case, I already had the wood lying around from other projects, and I had the tools and other materials as well, so all I needed was some time. I’d estimate the total time used up for this project at around 10-12 hours, spread over several days.

There’s a quick video you can watch, where I talk about how I made the shelves. It’s going to be useful if you want to undertake this project yourself.

http://www.youtube.com/watch?v=ERSpLtK7plM

I hope this (along with some of my other projects) helps inspire you to create something instead of buying it. There’s nothing wrong with buying something that’s well-made, but most of the stuff you find in stores today is made in a third-world country, with third-world standards, out of cheap materials, and will likely break in a few months. That’s not good enough for me, and I hope it’s not good enough for you, either.

Standard