2. Drupal 6 to Drupal 7 Upgrade
Legal Disclaimer
We have taken every precaution to ensure that the information presented in this
course is 100% accurate and with your best intention in mind.
Unfortunately, we can’t guarantee that you will have the same results. We wish we
could!
All results are based on many factors and it’s impossible for us to know how well
you will do.
You must accept the risk of any losses if you spend money because we don’t know
how well you will apply the techniques.
We are not liable for any decisions you make related to any information we have
provided.
All the content in this guide is owned by Ebizon Netinfo Pvt. Ltd.
Ebizon Netinfo Pvt. Ltd
Page 2
3. Drupal 6 to Drupal 7 Upgrade
A Personal Note
Hi Readers,
I have been lucky to guide a small base of loyal, engaged customers in a few years
span. And I take this opportunity to thank you for being a part of my work life.
I am not a Drupal developer but I am backed by a team of experienced Drupallers.
After taking technical knowledge and their challenges in making projects a huge
success, I usually rewrite so that I can guide my customers to make it easy to
understand.
You have trusted me to help you towards your journey to success. It’s a huge honor
and I take it seriously.
Instead of writing a 200 page handbook, I wanted to give you this 18 page
cookbook. It would be much more encouraging to read and I want you to follow
steps by step, so that you finish with an actual product that you would be proud of.
I am sincerely thankful for it.
With Gratitude,
Amit Sharma
Drupal Consultant
Ebizon Netinfo Pvt. Ltd
Page 3
4. Drupal 6 to Drupal 7 Upgrade
CONTENT AT A GLANCE
Contents
Legal Disclaimer ......................................................................................................................... 2
A Personal Note........................................................................................................................... 3
Drupal 7 Overview...................................................................................................................... 5
What has changed in Drupal 7 ? .......................................................................................... 5
Should you upgrade to Drupal 7 ? ....................................................................................... 6
What does your website have (Audit sheet) ? ............................................................... 8
D6 to D7 Upgrade Process..................................................................................................... 10
FAQ’s ............................................................................................................................................. 19
Feedback ................................................................................... Error! Bookmark not defined.
Ebizon Netinfo Pvt. Ltd
Page 4
5. Drupal 6 to Drupal 7 Upgrade
Drupal 7 Overview
Drupal is a publishing platform created by a community and bursting with
potential. Use as-is or snap in any of thousands of free designs and plug-ins for
rapid site assembly. Drupal's content management features make it easy to create
and manage website.
What has changed in Drupal 7 ?
● More Secure (Log-in, Password system, Modules, Scheduled tasks)
● Added more drag-and-drop for administrative tasks.
● Setting up automated task runs (cron) can now be achieved via Drupal's
configuration alone, without having to install any scripts on the web server.
● Moved text format permissions to the main permissions page
● Administrative links to edit existing page elements are now available on each
web page, without having to go to an administration page first.
● Improved support for integration of WYSIWYG editors.
● CKEditor and many other modules are compatible in IE 11.
● As database tables are converted in INNODB type so it becomes more fast to
use.
Ebizon Netinfo Pvt. Ltd
Page 5
6. Drupal 6 to Drupal 7 Upgrade
Should you upgrade to Drupal 7 ?
Your website might be running on Drupal 6 currently. It does what you need, so
why should you update it?
In a nutshell, Drupal 8 stable version is about to launch, at which point Drupal 6 will
become officially unsupported. This means that you will not continue to receive
updates and those important security patches will cease, leaving your site
potentially vulnerable to hackers. To avoid all these issues we would suggest you to
upgrade your site to Drupal 7.
When talking about upgrading it all comes down to money. Running and especially
developing on an older version of Drupal becomes more and more expensive over
time.
a) Development Cost :
Before a stable release of Drupal 7, development was very expensive because it
needs to be updated with changes in Drupal core while developing a web site at the
Ebizon Netinfo Pvt. Ltd
Page 6
7. Drupal 6 to Drupal 7 Upgrade
same time. When D7 comes out development still a bit more expensive than D6
because many modules have not been ported to it and naturally there is also some
extra overhead when developers are learning to use new features and APIs.
After D7 many contrib module developers add new functionality only to the latest
version of their module and site development starts getting more expensive again.
Over time many new features and modules are only published to the D7 and even
bug fixes to D6 will get lower priority
b) Maintenance Cost :
Ebizon Netinfo Pvt. Ltd
Page 7
8. Drupal 6 to Drupal 7 Upgrade
What does your website have (Audit sheet) ?
Perform the following tasks and Activities while Auditing
Technical Audit :
URL of Drupal 6 site:
Who developed original site (in-house/external):
Number of nodes:
Number of users:
Number of roles:
Number of Views:
Number of Content Types:
Number of Contributed Modules:
Number of vocabularies/terms:
Number of nodes tagged with taxonomy terms:
Custom Theme (yes/no):
Number of custom theme templates (.tpl.php files):
Custom modules (yes/no - number):
Hacks (yes/no):
Custom PHP (yes/no):
Custom Blocks:
JS Libraries:
Feeds:
Ebizon Netinfo Pvt. Ltd
Page 8
9. Drupal 6 to Drupal 7 Upgrade
Hosting environment (AFS, sites.stanford.edu,
department server, external host):
Number of vanity URLs / redirects:
Performance modifications (Boost, Varnish, Pressflow,
etc.):
Search (Solr / Google, internal):
Files on disk / DB:
Functional Audit :
Audit of existing content (using analytics, etc.) what is our critical content?
Critical functionality (e.g., data integration, etc.):
Content authoring experience (e.g., custom
workflows, dashboards, etc.):
User Experience (admin and end users):
Use of taxonomy:
Data integration (importing and/or exporting data
[Feeds, Services, etc.]):
Permissions matrix (permissions, access control,
Views access):
Rules and triggers:
Hosting environment (resources committed):
Layout Architecture (Panels, DS/Context,
block.tpl.php, etc.):
Navigation Architecture (Book, Taxonomy):
Data components (fields, attachments, files,
Ebizon Netinfo Pvt. Ltd
Page 9
10. Drupal 6 to Drupal 7 Upgrade
images, etc.):
Media Files:
D6 to D7 Upgrade Process
The Drupal upgrade process allow to update website from Drupal 6 to Drupal 7
using a simple procedure. The upgrade process automatically corrects any
functionality from Drupal 6 that was removed in Drupal 7 and updates content to
use new features where possible.
To demonstrate the upgrade process, a simple Drupal 6 site has been created and
the Devel module (http://drupal.org/project/devel) has been used to populate the
site with sample data. The site includes a blog, forums, a bunch of comments, and
regular pages and stories. The home page looks like the following screenshot:
Ebizon Netinfo Pvt. Ltd
Page 10
11. Drupal 6 to Drupal 7 Upgrade
These steps need to be done in one sitting so that your login information is not lost
and the process is not interrupted:
1. First we convert all custom modules and custom theme to Drupal 7.
2. Backup of website's database. If MySQL is there at backend, We can use
phpMyAdmin to export the database into a file. We can also use the Backup
and Migrate module (http://drupal.org/project/backup_migrate) to make a
backup of website database. The Backup and Migrate module has the added
benefit of being smart enough to know which tables are not need to back up
(for example, cache tables), and it can backup any data source.
3. Back up entire Drupal 6 installation. Pay careful attention to make sure that
this site would have all the information in sites directory since this is where
configuration files, contributed modules, custom code, and custom themes
are stored. we can also take a backup of any files that may have been
uploaded to the server as well as any other custom code that may have on
the site. we can make two backups- one of the entire site, and one for just of
sites directory, additional files, and other customized code. Log in to website
as the first user. This user will be needed to run the upgrade process.
4. Set this website to be offline. This prevents users from accessing the system
and interfering with the upgrade process or from seeing the site when it is
not fully operational. To put this website into offline mode, we will refer
maintenance
Ebizon Netinfo Pvt. Ltd
page
of
Drupal
6
site.
This
can
be
reached
at
Page 11
12. Drupal 6 to Drupal 7 Upgrade
http://www.yoursite.com/admin/settings/site-maintenance or by clicking on
Administer | Site configuration | Site maintenance from the menu:
5. After this site is in maintenance mode, we need to disable any custom
modules and custom themes that are installed. This will ensure they do not
interfere with the upgrade process. As part of this, we need to disable
website themes and return to a core theme such as Garland or Bluemarine.
If these themes are deactivated, It will need to reactivate one or the other.
6. Remove all of the old Drupal files from current site including any old Drupal 6
modules and themes. This will prevent the old files from conflicting with
Drupal 7.
Ebizon Netinfo Pvt. Ltd
Page 12
13. Drupal 6 to Drupal 7 Upgrade
7. Download and unpack Drupal 7 if it is not been done already and copy it to
the root directory for site.
8. Copy the information from old sites directory back to new site. Especially
make sure to copy settings.php file as well as any files that were uploaded to
the site.
9. If we customized core files such as .htaccess or robots.txt, we have to re-apply
the changes rather than copying the files over. This will preserve changes
made from Drupal 6 to Drupal 7.
10. Double check settings.php file to make sure that it has all of the correct
information for new site.
11. Run update.php by visiting http://www.yoursite.com/update.php. This will
start the upgrade process.
12. Drupal will first display a message describing the upgrade process and
reminding us to backup old database and source code, as shown in the
following screenshot:
Ebizon Netinfo Pvt. Ltd
Page 13
14. Drupal 6 to Drupal 7 Upgrade
13. After you click on the Continue button, Drupal will display a screen describing
the updates that will be applied during the upgrade process.
Ebizon Netinfo Pvt. Ltd
Page 14
15. Drupal 6 to Drupal 7 Upgrade
14. Selecting the Apply pending updates button will begin the upgrade process.
Please do not interrupt the installation process or refresh the page. The page will
automatically update to show the progress of the upgrade as each update is
applied.
15. When the upgrade is complete, Drupal will display a log describing the
changes that were made as well as any errors that may have occurred. After
it completes the upgrade, We can continue to either the front page of
website or the administration section.
Ebizon Netinfo Pvt. Ltd
Page 15
16. Drupal 6 to Drupal 7 Upgrade
Over to Customer….But Hang On..DID
YOU TEST??
HAHA! HE
MISSED ME
Ready for
HANDOVER
RESULT
What have you done
to my site?
AHHHH!!
LET ME CHECK!!
Now, that you have a complete working site, but are you sure that its working right?
Check content types, links, fields, files? Any errors?
There can be couple of issues that may have missed your attention and your client
may discover in use. So let’s discover these before they cause noticeable losses in
terms of clients, money and time.
Ebizon Netinfo Pvt. Ltd
Page 16
17. Drupal 6 to Drupal 7 Upgrade
Create a test plan to validate that the migration is working as expected and that all
the content has been migrated correctly. Ensure to perform following type of tests:
Data Migration testing
Ensuring data migration during upgrade is a major challenge. Follow these
parameters checklists to ensure that all types of content is included in the test data
Check the entire content already supported by Drupal 6 to ensure that data
integrity of the website
Ebizon Netinfo Pvt. Ltd
Page 17
18. Drupal 6 to Drupal 7 Upgrade
Migration Validation and Verification
You must perform these two sets of validation under this testing phase:
Verify that the content has been migrated to appropriate location in which
we check content issues, mapping specifications, script failures and
configuration
Verify that both migrated content and manually entered content work
together to render pages correctly on the website
Smoke Testing
After repeated verification and validation, this test is performed to check if all the
critical functionalities of your website is working fine
Congratulations! You have completed your upgrade process. I hope you are
much more comfortable with Drupal migration now. There are few difficulties that
may come in understanding functionalities, so I have prepared a list of FAQ’s to get
you familiar with it.
Ebizon Netinfo Pvt. Ltd
Page 18
19. Drupal 6 to Drupal 7 Upgrade
FAQ’s
1.
In Drupal 6, there is only one hook (hook_nodeapi) to handle node, comment, user
operations (view, insert etc). How to handle this in Drupal 7? Do we need to call any
extra module?
Solution: Drupal 7 is split into multiple hooks which eliminates the need to call
extra module. You can use different hook for different tasks as follows:
“hook_node_insert” for inserting node
“hook_comment_insert” for inserting comments
“hook_user_insert” for inserting user
We used “drupal_mail_send” function in Drupal 6 but I cannot found any formatted
e-mail headers, footers etc in Drupal 7. What is the solution?
Solution: Use “drupal_mail” with “hook_mail_alter” in Drupal 7
In Drupal 6, we used “Content profile” for extra fields in user profile which was
content type and used single tab to store all fields. But, in Drupal 7, content profile is
only node based and not entity bases. What is the solution?
Solution: Use “Profile2” module for creating extra fields
Ebizon Netinfo Pvt. Ltd
Page 19
20. Drupal 6 to Drupal 7 Upgrade
In Drupal 6, taxonomy is easily associated with content type but in Drupal 7,
taxonomy works like an entity and there is a separate field to attach taxonomy with
content type.
Solution: In Drupal 7, we can create separate field for referencing taxonomy with
content type
In Drupal 6, we have a single hook (hook_block for building blocks but Drupal 7 leads
with sepearte hooks for information, view etc. How to use them?
Solution: In Drupal 7, we use “hook_block_info” for creating information of block
and “hook_block_view” for viewing information
In Drupal 6, “Fivestar” module gives the functionality to connect directly to content
type. How does this module work in Drupal 7?
Solution: In Drupal 7, we need to create separate field for using fivestar module
in content type
In Drupal 6, a single hook (hook_taxonomy) is used to handle operations (insert,
delete the term). So even for single operation I need to use the whole hook. Is there
any solution for it in Drupal 7?
Solution: In Drupal 7, we can use different hooks for different operations as
follows:
Ebizon Netinfo Pvt. Ltd
Page 20
21. Drupal 6 to Drupal 7 Upgrade
Use “hook_taxonomy_vocabulary_insert” to insert vocabulary
Use “hook_taxonomy_term_insert” to insert term
In Drupal 6, there are no separate permissions for OG (organic group) but in Drupal 7,
OG has different roles and permissions. So problem arise to handle OG level
permissions & global level permissions in groups.delete the term).
Solution: Use “Strict node access permissions” checkbox from where you can
control permissions at group level.
In Drupal 6, OG works on node base but in Drupal 7, it works as an entity due to which
it gets attached with any entity such as node, taxonomy, user etc. How to cater to
this problem?
Solution: Use separate field for referencing, setting permissions and privacy.
How is database query of Drupal 7 different from Drupal 6?
Solution: In Drupal 7 , we have well formatted query to get users with Status 1
from “users” table.
Query in Drupal 7 is as follows:
$query =db_select(‘users’,’u’);
- >fields(‘u’)
-> condition(‘u.status’,1)
->execute()->fetchAll();
Ebizon Netinfo Pvt. Ltd
Page 21