Monday, December 22, 2014

Migrating Drupal 6 to Drupal 8


Drupal started its journey in year 2001. In 2015, Drupal is going to launch its 8th version. With release of new version migration from older version to the new version is always a big challenge.

Drupal 6 is one of the most popular version of Drupal. This post provides steps to migrate Drupal 6 to Drupal 8 (D6 to D8)

System Environment
In Drupal 8, Drush is an integral part of its development process. Migration is possible only from command line and using Drush. Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache. Drush is a part of GitHub. GitHub is a free distributed revision control system to provide speed, data integrity, and support for distributed, non-linear workflows.

Installation
You can get latest version of GitHub software at: http://git-scm.com/download

Drupal recommends installing Drush 7.x via Composer. Composer is a Dependency Management for PHP.
You can find instructions to install Composer on Windows or Linux / Unix / OSX machine at: https://getcomposer.org/doc/00-intro.md

After successfully installing GitHub and Composer, installing Drush 7 is easy. Open GitHub and type:
composer global require drush/drush:dev-master

Drush is now installed on your system. You can find more details on Drush installation on Drupal website at https://www.drupal.org/node/2366283

Set Paths
Now it is required to set path for Drush.
In Windows you can set the path manually from My Computer > Properties > Advance Setting > System Variable > Path

In Linux or Unix you can use bash profile file to add path.
The required components are installed.

Open Git.
Change root path to your drupal folder. For me it is:
cd c:/wamp/www/beta4

Check Drush status. Type:
drush status

Set Git path, type:
git init

Migrate
It is required that Migrate module is enabled in Drupal 8 website.

In order to execute a migration, manifest file is required. You can download the manifest files from Drupal website (https://drupal.org/node/2221779) and save it in the root folder of the Drupal.
Drupal supports two types of migration – module-by-module and complete migration. We will perform complete migration. It is required that all the modules used in your Drupal 6 website are enabled in Drupal 8 website.

Execute migration using drush command:
drush migrate-manifest --legacy-db-url=mysql://<username>:<password>@<host>:<portno>/<db_name> <manifest-name>

Where:
<manifest-name> is the name of the manifest file created for the migration. The path is not necessary, but the extension is (if there is one).
--legacy-db-url is a Drupal 6 style database URL.
<username> is the Drupal 6 database user name.
<password> is the Drupal 6 user's password to the database.
<host> is either localhost or the IP address of the database server. The normal "local" server's IP address is 127.0.0.1
<port> If you database is not using the standard port, you will need to specify your port number here. This is an optional setting.

I am working on my local setup and therefore the command is:
drush migrate-manifest --legacy-db-url=mysql://root:@localhost/drupal6 D6Manifest-Complete.yml

This completes the migration.
Drupal is still in its beta phase and is changing regularly, I had tested the above migration process with beta2 and beta4 releases of Drupal 8.

Thursday, December 4, 2014

New Features in Drupal 8

Drupal has come a long way and many big and popular websites are using Drupal. Drupal 8 is going to provide features important to handle such websites. This post is an attempt to explain some of the new features of Drupal 8.

Mobile-friendly

With increase in mobile devices, it is very important to have a website which is mobile friendly. Looking at this important need Drupal 8 has come with “mobile-first” framework. All built-in themes are responsive, and even administration pages are mobile device friendly. Tables shrink properly, and the new admin toolbar is mobile from the start. HTML5 industry standard is now included in Drupal 8 which means Drupal now has proper native input tools on mobile for fields like date, e-mail, and phone.

Better Authoring with WYSIWYG editor

Lack of WYSIWYG editor was a long pending drawback of Drupal. But Drupal 8 comes with the new editor functionality and bundled CKEditor WYSIWYG editor. Apart from regular editorial features, the editor also provides facility of in-place editing of content without having to use the full edit form and save as draft.

Multilingual Support

For today’s global world, multilingual support is a prime concern for all big websites. Drupal had always provided multilingual support. In Drupal 8 these capabilities are further enhanced with built-in user interface to translate anything in the system, build pages with views language filtering and block visibility and software translation automatic updates from Drupal community. The over-all multilingual experience is made simpler.

Theming – Layout development

In Drupal 8 Twig replaces PHPTemplate as the default templating engine. With this change learning PHP for theming Drupal is no longer necessary. Apart from an easier tag-based syntax, Twig offers a lot more security at the theming level.

Views

Views is one of the most popular Drupal module that allows non developers to create lists, posts, galleries, tables, maps, graphs, menu items, blocks, reports, forum posts and more. In Drupal 8 Views is now built into the core CMS and it is deeply integrated. Almost all the pages are now View including front page listing, administration pages, etc. With this, it is now easier to customize the front page, listing blocks and even create custom admin pages and actions.

More field types

Customization is main feature of Drupal. In Drupal 8 more field types are included in the core. These fields can be easily attached to content types. New field type includes entity reference, link, date, e-mail, telephone, etc. Comments are also a field now.

Built-in Web Services

Drupal 8 implements state-of-the-art Hypertext Application Language (HAL) which creates endless possibilities like building mobile apps with Drupal as the data source, or even post data back to Drupal from the client, expose content as JSON or XML, authenticate a client with HTTP authentication, or expose view-generated list as services.

Configuration Management

Drupal 8 is an attempt to meet the credentials of best software and configuration management is an important part of it. Configuration management keeps track of all the important details as content is configured and revised. Drupal 8 comes with a file system-based configuration management system, which makes it simple to transport configuration changes such as new content types, fields, or views from development to production.

Accessibility

Drupal 8 has added extensive support for standard accessibility technologies including WAI-ARIA. WAI-ARIA defines a way to make Web content and Web applications more accessible to people with disabilities.

Modern

Drupal 8 supports latest PHP standards and support many popular external libraries: Composer, PHPUnit, Guzzle, Zend Feed Component, Assetic and more.

My next post will be on the Migration from Drupal 6 to Drupal 8.