Exporting D6 content to D7 website

Now that D6 is no longer supported, it was a must to move D6 sites I maintain to D7. This guide is the recipe to moving simple content with non-complicated CCK fields from D6 site to a D7 site.

Prepare your new site

Create all required content types on the new D7 site. Add all required fields to content types.

Using the Migrate Source CSV plugin

NOTE: A more complete example module can be found at https://github.com/heddn/d8_custom_migrate.

The Migrate Source CSV module provides a source plugin for utilizing .csv files as migration sources.

How to import a simple CSV-file with Migrate Source CSV plugin

This very basic example will show you how to import Title and Body into the Article content type from a CSV-file.

Migrate: copy over data to Drupal from other sources

The core migrate module in Drupal 8 provides a system to move data to Drupal from other sources. Third party modules would define migrations from other systems. See for example https://www.drupal.org/documentation/modules/migrate_drupal which defines sources for Drupal 6, 7 and 8 data.

See also the migration API in Drupal 8 to define sources and targets yourself.

Migration from other solutions

This is just an outline, please help completing this page with more details.

It is quite easy to migrate from many other "media" solutions to Scald.

General purpose methods

From IMCE/embedded images modules

Get a list of used files from the text fields/from the {files} table and create scald_image atoms. Enable MEE module.

From File Entity based modules

Add an atom for each file, use hooks to create new atom when a file is added.

From File Field modules

Use Atom Reference module.

Less commonly implemented Migration methods

pre/post Import/Rollback methods

You can execute code before or after an import or rollback operation by implementing the Migration class methods preImport(), postImport(), preRollback(), or postRollback(). Each of these is called once per individual Migration - that is, if you implement preImport() in an article node migration class, it will be called after any previous migrations you're running, and immediately before the first row of your article node migration is called.

Typical actions can be the enabling / disabling of certain modules or changing configurations.

class ArticleMigration implements Migration {
  public function preImport() {
    // Code to execute before first article row is imported
  public function postImport() {
    // Code to execute after the last article row has been imported
  public function preRollback() {
    // Code to execute before first article row is deleted
  public function postRollback() {
    // Code to execute after the last article row has been deleted

A practical example can be found here.

Backup your database and files

Website backups are more than just an element of best practices, they are essential!

If for any reason your website goes awry the option of restoring it from a recent backup is often the best solution, and sometimes it is the only one available. To create a complete backup the database and the custom files will both need to be backed up. An automatic backup strategy is easy to implement using the Backup & Migrate module, and a manual backup can be created before major updates or new implementations, providing a convenient restore point taken immediately prior to the changes going in.

Backup & Migrate

The Backup & Migrate module facilitates emergency recovery and site migration. You can configure it for automatic backups saved to the filesystem - with more frequent backups during development.

You can also create a manual backup before undertaking any complex configuration. That way, you have a "restore point" in case of disaster.

While there may be some issues of security when you save the database and content as a file (you could exclude certain tables, perhaps), the benefits of having a rollback in case of disaster are significant.


Subscribe with RSS Subscribe to RSS - migration