Undefined index: distribution_name when upgrading Drupal 6 to Drupal 7

Wow, its been a while since I lasted posted.

Over the last year and a half I have been upgrading a lot of Drupal 6 sites to Drupal 7.  I have found many times that different sites like to throw different errors (or sometimes now errors) after upgrading.  I have been plagued by one specific error on a number of sites.

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 207 of /var/www/drupal/includes/install.inc).

Alas, after a year of searching, I finally found the solution at Drupal.org .  Apparently what happens in the upgrade, sometimes, is that all of the installation profiles in Drupal are disabled.  Why?  I have no idea.  If you were to look in install.inc, you would see the following code.

<?php
$profile = drupal_get_profile();
$info = system_get_info('module', $profile);
return $info['distribution_name'];
?>

So with the profiles disabled, ‘distribution_name’ doesn’t exist.  So what do you need to do?  Well enable a profile of course!  Only one problem, there is no way in Drupal to enable a profile without getting in to the database.  To fix this, you will need access to mysql or phpmyadmin and you’ll want to run the following SQL command

UPDATE system SET status=1 WHERE name='standard';

This will reactivate the Standard profile in Drupal and your distribution_name error should disappear.

Backups: They’re Important for Everyone

Backups are one of the most important responsibilities that home users neglect.  Most of the time this is because home users don’t realize how important their data is until either their hard drive crashes, their house starts on fire, or their computer is stolen.

Types of Data

There are many different types of data that home users should backup.  A lot of home users don’t think backups are important because they don’t have financial or tax information on their system. This is a completely false assumption.  Data such as music, home movies, and college papers should be backed up regularly.  I have a friend whose laptop was stolen out of her boyfriend car and I’m sure see lost several papers that were due. Recently one of my family members had their computer stolen, and has probably lost all of their iTunes music.

What a backup isn’t…

There is a common misconception that moving (not copying) files to an external drive is a sufficient backup.  Actually, its not a backup at all.  As long as your have 1 copy of a file, you don’t have a backup.  In order to have a real backup, you must have at least 2 copies of a file.

3-2-1 Rule

One thing I’ve seen posted all over the internet is the mention of the Backup 3-2-1 rule.  This is probably the most useful rule you can remember when it comes to backups. The 3-2-1 rule states that you should keep three copies of any important files, that includes the primary copy and 2 backups. You should store your files on two different types of media, this could be hard drives and optical media such as blu-rays or dvd’s. Finally, 1 of your backups should be backed up offsite.

How do I set it up?

It’s always a good idea to keep a local and offsite backup.  For a local backup, I’d recommend purchasing an external harddrive to keep plugged in to your computer.  If you have Mac OS, you can use Time Machine to keep local backups of your system, otherwise you can download a free program called Crashplan that will let your perform backups without much configuration on your part.  Just make sure its backing up to your usb drive.  As for offsite there are multiple services that will take care of automatically backup such as Crashplan and Carbonite. I’ve only ever used Crashplan so I’ll speak to that.  For $50 a year, you can backup all of your data to Crashplan’s server, or else if you have a friend that has a lot of extra storage space that they’d be willing to share, if they install crashplan, you can backup to their system securely. Carbonite will allow you to backup to their servers for around $60 a month I believe.

As usual, post any questions or comments below.

Installing and Using MacPorts in Mac OS X Mountain Lion

With the release of Mac OS 10.8 (Mountain Lion), Apple changed how you gain access to make and gcc.  In previous version of Mac OS you could install xcode and everything would work fine. In 10.8 the installation of the command line tools as a separate package is required.  To make things more frustrating, while Xcode is available in the Mac App store, the command line tools are not.  In order to get the command line tools, you must sign up for an Apple Developer account (a free account works).

Once you download and install the command line tools package you can download the MacPorts packages form their website at http://www.macports.org.

If you upgraded from Lion to Mountain Lion and had MacPorts installed prior to the upgrade, you will need to reinstall Xcode from the App store, then install the command line tools, then reinstall MacPorts. Then you will need to run port upgrade outdated to update your packages from the Darwin 11 version to Darwin 12. You may receive an error in reference to a library package.  If that happens trying running port clean “packagename”.

Make Vim more Python friendly…

Here are a few lines for the vimrc file that will make vim a little more Python friendly by providing autoindent.

syntax on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4

Update: After settings these, I found that copying text in to vim turned out to be a nightmare. So here is how you get around that.
Type:
:set paste
before pasting, and then type
:set nopaste
when you’re done to restore the vimrc settings.

Update: I am looking for ways to improve my vimrc even more, if you have any ideas, please let me know in the comments section. Thanks!

Android vs iOS A Mini Review #2: Music

This post will definitely not be a “which is better” post, because it 100% depends on what your music situation.  They both can be just as decent depending on how you have your music library setup.

The “Cloud”

Cloud computing has dramatically changed the way we think about using consumer products.  Now, the cloud has been around for a long time, but the term didn’t really gain a lot of popularity until the last several years when companies really started embracing it.

Companies have brought us a new option for storing music by taking advantage of the cloud.  Google, Amazon, and Apple now offer music storage services on their own services, and as long as you have an internet connection you should be able to access your music.

Not all cloud music services are created equal however.  Apple charges 25 dollars a year for their music storage solution, but they claim one feature that Amazon and Google currently do not (as far as I know).  Apple’s match service allows a user to upload their iTunes library to Apple’s servers.  They will scan each song, and if they have that song in their library, they will provide you with a 256kb version over the version that you have.  If they don’t have that song in their system, then they will upload your copy.

Google and Amazon offer 5gb of free music storage and they will upload all of your music, providing they are DRM free.  I’m assuming if you bought music from their stores than they might be an exception.

I have my music, mostly, on all three services. Yes I paid Apple to store my music, but I’m also an iPhone user and have a MacBook Pro, plus a PC and thought it would come in handy.  I only used Amazon’s music service so that I could access my music from my Kindle.  It seemed to work fine. I wasn’t able to find a Google made music app for iPhone, but a third party app seemed to work alright as well. When I had my Droid X, there was a really decent Google Music app made by Google that I used frequently.  A plus to Google Music is the fact that it has a web interface, so you can access your music from any computer that has an internet browser.  There were times when the music would cut out on the website and just stop playing, but I wasn’t sure if that was Google Music or something on my system.

Apple’s iTunes match has no web interface, and requires you have iTunes or an iOS device to access your music in the cloud.  It was really nice to use on my Macbook since I had installed a 128gb SSD and really didn’t want to use up all of the space with my music library. I could just stream the music from the internet via iTunes.

iTunes Library

If you don’t have an iTunes library, have no desire to ever have one, will never have an iPhone, iPod, or iPad… skip this section, it probably will never apply to you.

Now if you do have an iTunes library, syncing with the latest iOS is really nice.  You can use iTunes match and never sync and just choose what songs you want to play and stream them, but personally I like having my library on the local device. (My iTunes library really isn’t that big so I can afford to use my iPhone’s storage). With iOS, iTunes can be synced either via wireless or via usb cable. There are some settings in iTunes but its simple.

Syncing with Android is possible, but when I first attempted it, it didn’t work very well.  That could have been because of my Droid X, I’m really not sure. Android users need to install a program on the computer with their iTunes library called DoubleTwist, and install the app on their phone. Also for like 5 dollars you can sync wirelessly.  This application will sync your iTunes drm free songs with your Android device.

Android Storage

If you don’t have iTunes but still want to store music locally, you can.  It’s as simple as copying and pasting to your phone. I won’t go in to too much detail as there are probably 1000 ways to do it.

Conclusion

If you have an iTunes library, then iOS… if you don’t have an iTunes library then Android, unless you take the cloud storage option. It all really depends on your situation, and neither is really better than the other in this case. No matter what, if you want music stored locally on your iOS device, you must have iTunes, while on Android there really is no application requirement.