Book Image

Migrating to Drupal 7

By : Trevor James
Book Image

Migrating to Drupal 7

By: Trevor James

Overview of this book

<p>This book will show you how to migrate your content into the Drupal content management system. You&rsquo;ll start by building a content type in Drupal to hold your migrated content. You&rsquo;ll then import your content into Drupal using the Feeds module. In order to be able to easily use them again and again, you will also learn the best methods of maintaining and packaging migration configurations.<br /><br />In "Migrating to Drupal 7" you&rsquo;ll learn how to quickly package your legacy site&rsquo;s data into a format that&rsquo;s easy to import into Drupal. You&rsquo;ll then build a content type to hold migrated data in Drupal. To save time and hassle you will learn how to import content into Drupal using the Feeds module. You&rsquo;ll then get a brief introduction to the Migrate module and its powerful features.<br /><br />With this guide you&rsquo;ll also learn how to upgrade your Drupal 6 website to Drupal 7 in short, simple steps. You&rsquo;ll also learn how to package your configuration code in Drupal using the powerful Features module.<br /><br />In "Migrating to Drupal 7" you&rsquo;ll start by collecting your current site&rsquo;s content and packaging it up into a CSV file so you can easily import it into Drupal. You&rsquo;ll then build a content type to hold your migrated data and content. <br /><br />Mastering migrations using the Feeds module will be the next invaluable tutorial before you get a closer look at the Migrate module&rsquo;s powerful features. You&rsquo;ll then upgrade your Drupal 6 site to Drupal 7 and use helper modules to help run the upgrade faster and with less hassle. This book will then take you through the process of migrating CCK-based Drupal 6 fields to Drupal 7 using the Content Migrate module. <br /><br />Using the Features module you will then package up our Feeds importer and content types into code to help you to build an easily maintainable and flexible Drupal website with.</p>
Table of Contents (16 chapters)
Migrating to Drupal 7
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
5
Maintaining a Migration Path
8
Migrating Content from Earlier Drupal Versions
Index

Preface

Both new and seasoned users of the Drupal content management framework want to migrate content from other websites and sources into the Drupal system. You may have a website built in a different codebase and database system that you want to move into Drupal. As long as that system allows for exporting of data into CSV, RSS and/or XML, you can get this content imported to Drupal easily. With Drupal you can easily import this data into its MySQL-driven database and PHP-driven structure, simply by configuring powerful modules and running an import, all from the Drupal interface. You can set up a website using Drupal, literally in hours, that contains the exact same content as your older legacy site just by using these migration and import processes.

You can also migrate content into Drupal 7 from earlier versions of Drupal as well as other open source content management systems. This book will provide all the steps you need to migrate content into the Drupal framework in order to build a next generation dynamic website using the same content you've been hosting in another website application. You can build a Drupal website without sacrificing any of your existing content.

What this book covers

Chapter 1, Preparing Drupal for Content Migration, details how to prep your Drupal website for imports of content and data from a legacy content management system or other site. Performance considerations, core Drupal modules, required contributed modules, and setup of the Feeds module and the Feeds Tamper module will all be discussed. Other modules including the Migrate module will be detailed. We will also prep our data export and get it ready to import into Drupal.

Chapter 2, Starting a Migration Path, shows how to create your content type and fields in Drupal that will contain your imported content. We'll create a new Drupal content type, build out a map of the types of fields we'll be importing, create the fields and add them to the content type in Drupal, discuss migration of files including images, set up some image handling, and add validation to our fields. We'll also create entity reference fields, term reference fields, and field collections.

Chapter 3, Creating a Feeds Importer, dives into using the Feeds module to configure our importers. We'll create a feeds importer, and look at basic settings including exporting, cloning, deleting, and tampering. We'll tweak our feeds importer settings including the fetcher, parser, and processor. We'll attach a feeds importer to a content type and also use the standalone feeds importer form. You'll learn how to create the feed importer mapping in order to map your legacy data into the Drupal fields you've created. Then you'll run the initial import and test it.

Chapter 4, Feeds Tampers, expands the configuration of our feeds importer by adding tampers to the mapping. We'll use the Feeds Tamper module, create a tamper for a few of our fields, and use the tamper for multivalue piped and/or comma-separated data. We'll create a tamper to handle character sets, and other plugins including HTML, other text, string, and lists. We'll run an import using the tamper plugin and test the import to confirm that the tamper worked.

Chapter 5, Maintaining a Migration Path, explains how to manage and maintain our migration path, using feeds, over time. We'll clone importers and re-run our imports to update and replace content.

Chapter 6, Packaging Content Types and Feeds Importers, shows you how to use the powerful Features module to save your feeds configurations to code and store them in a module(s) format. You can then share and implement these modules across other sites you manage.

Chapter 7, Migration Using the Migrate Module, jumps into a discussion and demo of the Migrate module. We'll install and use the Migrate module to migrate content from other sources into our site.

Chapter 8, Migrating Content from Earlier Drupal Versions, shows you how to export your content from a Drupal 6 site and import it to a Drupal 7 site for migration and upgrade reasons. We'll run through the basic steps of a Drupal 6 to 7 upgrade path for content migration.

Chapter 9, Migrating from WordPress, takes content and data from the popular Wordpress blog application framework and migrates this blog content into your Drupal site. We'll use a module called Wordpress Migrate in this chapter.

What you need for this book

To run the examples in the book, you will need the following:

  • Drupal 7 website running in a local environment or hosted environment

  • Content or data in a CSV file that you will be importing into Drupal

  • RSS or XML feeds that you want to import

For this book, it is assumed that you have a working installation of Drupal 7 on either your localhost server or on a hosted server. All the examples will be run on a localhost version of Drupal running in the MAMP environment but you can also work with XAMPP, WAMP, or any of the myriad of Drupal package installers that are available. I won't be describing the Drupal install process in detail as there are many resources out there that can help you install Drupal. So it's assumed that you have core Drupal installed and are ready to go. I will explain all install processes for the modules we're going to use including the Feeds, Feeds Tamper, Migrate, and Wordpress Migrate modules.

Who this book is for

This book is for Drupal users, website managers, webmasters, content editors, or developers who have already installed and configured a Drupal site and understand its web-based administration; and who want to import data from other sources and websites into the Drupal framework.

This book will have little in terms of programming or code. Everything we do in the book will be configured easily by using the Drupal administration interface and module admin screens. We will look at some code briefly when we set up our Feature modules. You do not need to have any previous MySQL or PHP experience to work through these examples.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Install this module, as you would do for any Drupal contributed module, to your /sites/all/modules/contrib directory".

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Go to your core modules admin screen and uncheck the Toolbar module to disable it".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.