A Closer Look at Drupal 7

I use Google to find many of the things I want to learn about. Sometimes the list of links it returns can be a little disappointing. Upgrading from Drupal 6 to Drupal 7 is one of those situations that is bringing a variety of results that don’t quite hit the mark. Of course what I’m finding today will change in the days and weeks to come so your experiences will vary. I hope to continue updating this article as I find more useful information.

Sometimes the most obvious places get overlooked. For instance, the Upgrade.txt file in the Drupal7 installation is a good place to start looking. Here are some other good places I’ve started looking:

From the Drupal Handbook Documents Administration Guide look at these sections:
After you get a fundamental Drupal 7 installation working the following guides are helpful:

Database API

I haven’t found a nice pushbutton solution to upgrading the databases between D6 and D7. Diving into relevant database documentation is the best choice as I can see it right now.

Links Found That May Be Useful? 

I haven’t read the following articles yet but they may have some useful information so I’m bookmarking them here for now:

Database Migration

 About SomeoneKnows 
(c) 2011 Vince Thompson
Advertisements

Drupal 7 – Are We There Yet?

When I started picking up on Drupal I began learning about Drupal 6 because Drupal 7 was off in the distant future. Well, Drupal 7 was released for production on Jan. 5 this year and I’ve still been in the “sometime in the future mode” until the last few days (peeling back the onion some more) http://drupal.org/drupal-7.0. Now, work has begun on Drupal 8 to be released sometime in the future.

Drupal 7 has some features that make sense for a new web site I’m working on – Organic Groups and Web Services. While these aren’t new they have some updates to the way they work. The CCK and Views have been two of the most important modules for Drupal 6 web sites. It appears that Drupal 7 now replaces them with Fields. Drupal 8 is planned to include some features I want to design for like incorporating a higher degree of web services. I ordered another book that should arrive today, this one about Drupal 6 Web Services.  http://www.amazon.com/gp/product/1849510989 I see web services as an important component in connecting interactions between Drupal and MicroStation, AutoCad or other future CAD/CAE systems. Since I’m starting off with a new web project is seems like the best time to jump into Drupal 7 development.

Using Git to Download Drupal 7

I don’t understand enough about Git yet but was able to use it and get a copy from the Drupal Git repository. I was worried about making mistakes in setting up my local repository like where it should reside how can I undo a mistake. I made a few mistakes along the way and learned they could be erased by deleting the “.git” folder. If it turns out I overlooked something about erasing a repository I’ll add more information here. This article seemed to be helpful: http://drupal.org/node/803746#setup I managed to get a local site working with Drupal 7 last night.

I got a rudimentary install with Organic Groups and several other features set up within a Drupal 7 environment. So far, so good. Something I could use some help with is finding out what the recommended practice are to take the MySql database from its Drupal 6 configuration to Drupal 7. My initial search didn’t come up with a worthwhile suggestion yet. Maybe I’m just not looking in the right place.

 About SomeoneKnows 
(c) 2011 Vince Thompson

Drupal Taxonomy

Drupal has an unbelievable collection of features. So much of the time I feel like I’m constantly peeling away different layers of an onion trying to get to an understanding of what it does and how to make it work. It is designed to separate the programming code from the information. The information – things like labels, values for check boxes, radio buttons, or selection lists gets stored in the database while modules provide the programming framework. Drupal is a true database driven system

Taxonomy reinforces this separation of programming features from the information (data) and what it means. If  you’re spending some time learning about Drupal I thought you might find the following video interesting to watch. http://gotdrupal.com/videos/drupal-taxonomy It is a bit long around 50 minutes but it does make some good points about taxonomy and how its used.

Setting Up an IDE for Drupal Development

I founded a group in Kansas City called Make:KC in July 2009 inspired by Make Magazine, their Maker Faires, and the www.makezine.com web site. I started with a MakeKC WordPress blog using WordPress’ free blogging site. Then I registered our www.MakeKC.org domain name and started using Drupal in December 2009. Make:KC is a non-profit organization.

I’ve tried setting up an Integrated Development Environment (IDE) using Eclipse and then NetBeans. Both seem to work well as editors but I was having trouble getting a debugger working that would allow me to step through the PHP commands on our web site. Most of the time these tools have not been needed while using Drupal’s menu style configuration. But I’m wanting to work on developing some modules too.

NetBeans and xdebug

I tried to get debugging working for Drupal sometime last year. At that time I tried Eclipse and NetBeans. I’m spending more time learning to develop in Drupal so I need this to work. It helps to step through commands with a debugger and learn what takes place in Drupal’s code; learning why, how, and when commands are executed.

I’m sure Eclipse is a great IDE to work with but I managed to get debugging working in NetBeans first. I had an older version already on my computer but installed the newer NetBeans 7.0 version today and now I have debugging working on the server side.

I had already downloaded the xdebug program but setting it up to work with the IDE was my problem. I found this web site with some answers I needed: http://2bits.com/articles/setting-up-xdebug-dbgp-for-php-on-debian-ubuntu.html
The section about adding the following instructions to my /etc/php5/apache2/php.ini file seemed to make things work:

zend_extension=/usr/lib/php5/20051025/xdebug.so

[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=0
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=

; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32

; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32

I need to read the article “Introducing xdebug”, it looks like it has some really good information: http://devzone.zend.com/article/2803-Introducing-xdebug

 About SomeoneKnows 
(c) 2011 Vince Thompson

Our Drupal Site Backed Up to a Laptop

Putting MakeKC.org on a Laptop

I have been spending time lately learning more about Drupal. The more I learn, the more I’m impressed with the system so I decided to write this up and post it to my blog.

I’ve wanted to have a local copy of our MakeKC live website on my home machine for testing and backup but I was having trouble getting the database installed. The phpMySql program wouldn’t let the large database dmp file load. The solution was actually simple but requires a command line keyin in the form:

mysql -u username -p databasename < backupfilename.sql

or in my case:

mysql -u makekcAcct -p databaseForMakekc < myHostingAcct-databaseForMakekc-4-25-2011.dmp 

I copied all of the files from makekc.org’s drupal6 directory down to my local machine. I have Ubuntu with Apache, PHP, and MySql installed. I copied the directory to my computer at:  ~home/www/makekc.local/drupal6 (where ~home is the shortcut notation for my home directory).

I added the a static IP address to the /etc/hosts file

127.0.0.1    localhost
127.0.0.7    makekc.local

(I happen to be using other ip addresses and the next in line was 127.0.0.7 at the time).

A Revelation About Website Root Directories

I’m using the versions of Apache, PHP, and MySql offered by Ubuntu’s Synaptic Package Manager. This causes my web site files to be placed off the root directory at /var/www/myVirtualDomains. Up until now I thought each of my local web sites had to go into the /var/www/ directory for special web site purposes. I wondered if pointing to a different web root directory inside my home directory would work. So I added the following to my /etc/apache2/sites-enabled/000-default file:

<VirtualHost makekc.local:80>
   ServerAdmin webmaster@makekc.local
   DocumentRoot /home/someoneknows/www/makekc.local/drupal6
   ServerName makekc.local
   ServerAlias www.makekc.local
   ErrorLog /var/log/apache2/makekc.local-error_log
   CustomLog /var/log/apache2/makekc.local-access_log common
</VirtualHost> 

Turns out it that pointing to a web root directory in my login account works there too.

With the website files and the web server configuration in place I restarted the server. Then navigated to the web page using makekc.local. The same homepage from the live website was showing up on my makekc.local site too. But when I tried logging in or going to one of the links in the site they didn’t work.

Enabling Clean URLs

I finally realized that the links to other pages probably weren’t working because Clean URLs are enabled on the live site but my default apache installation didn’t allow my Drupal install to Enable Clean URLs.  I didn’t take the time to learn how to apply the proper configuration at the time for my laptop computer to allow mod_rewrite to work.

It took a while but I finally found the command “sudo a2enmod rewrite“, this sets up apache to allow rewrites to happen. Then I changed the /ect/apache2/sites-enabled/000-default file again to change AllowOveride  None to AllowOverride All as in:

   <Directory />
       Options FollowSymLinks
       AllowOverride All
   </Directory>

After restarting Apache again I finally have a working local copy on my computer with the same contents and functionality as our live site.

 About SomeoneKnows 
(c) 2011 Vince Thompson