PHPackages                             chillu/drupal-blog-importer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chillu/drupal-blog-importer

AbandonedArchivedSilverstripe-module[Utility &amp; Helpers](/categories/utility)

chillu/drupal-blog-importer
===========================

Imports Drupal Blog structures (incl. comments and authors) into SilverStripe CMS for usage with the blog module

0.1.x-dev(12y ago)1761BSD-3-ClausePHPPHP &gt;=5.3.2

Since Aug 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/chillu/silverstripe-drupal-blog-importer)[ Packagist](https://packagist.org/packages/chillu/drupal-blog-importer)[ Docs](http://silverstripe.org)[ RSS](/packages/chillu-drupal-blog-importer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Drupal Blog Importer for the SilverStripe Blog Module
=====================================================

[](#drupal-blog-importer-for-the-silverstripe-blog-module)

[![Build Status](https://camo.githubusercontent.com/3a543c7dc6ef452705b3874a62166159faff5615faf56804c39332eee2edcb54/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6368696c6c752f73696c7665727374726970652d64727570616c2d626c6f672d696d706f727465722e706e67)](http://travis-ci.org/chillu/silverstripe-drupal-blog-importer)

Converts Drupal blog data into a SilverStripe blog (built with the [blog module](https://github.com/silverstripe/silverstripe-blog)).

- Imports posts and tags in standard blog structures
- Imports comments with the ["comments" module](https://github.com/silverstripe/silverstripe-comments) (optional)
- Imports blog authors and comment authors into `Member` records (optional)
- Imports tags into many-many relationships created by the ["blogcategories" module](https://github.com/IOTI/silverstripe-blogcategories) (optional)
- Rewrites relative images in blog post body to a custom local folder (for manual migration)
- Downloads relative images and rewrites them into a provided folder (optional)
- Import posts from different blogs into different "blog holders"
- Based on available CSV data, no Drupal module installation or application access required
- Supports incremental imports and updates
- Generates Apache rewrite rules for post URLs

*Caution*: The module is in alpha status, and has only been tested against Drupal 5 so far. It doesn't do a full import of every data point, see known limitations below.

Setup
-----

[](#setup)

### SilverStripe Extensions

[](#silverstripe-extensions)

The SilverStripe blog and comments module don't provide all the columns necessary to map the existing Drupal data, so we need to extend them by a few columns. For example, Drupal comments have a subject line. Add the following to your config (e.g. in `mysite/_config/config.yml`):

```
BlogEntry:
  extensions:
    - DrupalBlogEntryExtension
Comment:
  extensions:
    - DrupalCommentExtension
Member:
  extensions:
    - DrupalMemberExtension

```

This is an optional step, and you'll need to adjust templates and CMS logic to take advantage of those new columns.

### SQL Export Script

[](#sql-export-script)

The export logic is placed in `tools/export.sql`.

The module operates on CSV data, which can be retrieved through the MySQL commandline tool. Please note that the SQL user needs to have been granted `File` permissions, since the script uses `SELECT ... INTO OUTFILE`.

The script assumes your column type for blog nodes is called 'column'. If its called something different (e.g. 'blog'), replace the value in the SQL script. Don't forget to add any table name prefixes should you have configured them.

By default, the CSV data is exported to the `/tmp` folder. Change the script paths if you don't have access to this location. We're using specific joins and composite columns, so a straight CSV export of the table data from your own tools won't work - please use this script.

Usage
-----

[](#usage)

### Export from Drupal

[](#export-from-drupal)

Run the following command:

```
mysql -u  -p  < drupal-blog-importer/tools/export.sql

```

### Import into SilverStripe

[](#import-into-silverstripe)

Run the following command in the SilverStripe webroot:

```
sake dev/tasks/DrupalBlogImporterTask postFile=/tmp/posts.csv userFile=/tmp/users.csv commentFile=/tmp/comments.csv

```

You can leave out arguments to only import partial data.

Available arguments:

- `postFile`: Absolute or relative path of CSV file for blog posts
- `commentFile`: Absolute or relative path of CSV file for comments
- `userFile`: Absolute or relative path of CSV file for users
- `publish`: Publish created blog pages?

Extending the importer
----------------------

[](#extending-the-importer)

The importer might not fully fit your requirements. E.g, tags might be imported with the "blogcategories" moduleas many-many relationships, or comment authors imported with nicknames matching their profile on the \["forum" module\].

The CSV import logic is based on a core class, `CSVBulkLoader`. It provides a lot of flexibility in transforming and remapping data. Each type (users, comments, posts) has their own loader class, which can be subclassed.

```
:::php
class MyDrupalBlogPostBulkLoader extends DrupalBlogPostBulkLoader {
	public $columnMap = array(
		'tags' => '->importTags',
		// ...
	);
	protected function importTags($obj, $val, $record) {
		// Example: Look up many-many relation, and add new objects
	}
}

```

Simply instruct the dependency injector to use those classes instead (e.g. in `mysite/_config/injector.yml`):

```
Injector:
	DrupalBlogPostBulkLoader:
		class: MyDrupalBlogPostBulkLoader

```

Limitations
-----------

[](#limitations)

- Blog post revision history is discarded
- Blog post subscriptions by registered users are discarded
- Blog post access control is ignored
- Comment threads are flattened
- Users don't have a public profile or the ability to log in
- Tags are not weighted, term hierarchies are flattened
- View counts are not kept updated (unless specifically implemented)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4673d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/111025?v=4)[Ingo Schommer](/maintainers/chillu)[@chillu](https://github.com/chillu)

---

Top Contributors

[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (52 commits)")

---

Tags

silverstripecms

### Embed Badge

![Health badge](/badges/chillu-drupal-blog-importer/health.svg)

```
[![Health](https://phpackages.com/badges/chillu-drupal-blog-importer/health.svg)](https://phpackages.com/packages/chillu-drupal-blog-importer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
