Skip to content

A simple script for exporting comments out of a Drupal 6 database into DISQUS compatible XML files

License

Notifications You must be signed in to change notification settings

pichot/drupal6-to-disqus-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What This Does

This is a small script that will export comments out of a Drupal 6 database and into DISQUS compatible XML files. DISQUS does not allow XML files larger than 50MB, so this script will output files at around 45MB each.

Limitations and Known Issues

I wrote this for a client that did not require threaded comments, thus this script will only export your comments as a flat, chronological thread.

I've only tested this on my own computer (Mac OS 10.7). It should work on any *nix OS with Ruby 1.9 and the requisite gems.

The Builder gem is supposed to check for correct UTF-8 encoding when building the XML file but I still encountered several comments that had encoding issues. Though this gem might help.

DISQUS has a limit of 25000 characters per comment body. The script will still export comments that are longer, but the DISQUS importer will ignore them.

How To Use It

Place this code on the same server as your Drupal database. The script only needs the node and comments tables, so you can also just dump those to your local machine and run the script there.

First, make sure you have the required gems:

bundle install

Next, edit config.example, filling in your database credentials, and save the file as config.

Finally, run the script from inside the project directory.

ruby xml-export

The XML files will be generated and placed in the same directory as the script.

Author

Jonathan Pichot @jonpichot http://jpichot.com

License

Since this is my first open source code, I wasn't sure what license to choose. I settled on MIT since I understand it to be one of the more lenient licenses. If you ever do package this code, I'd appreciate attribution, but the license doesn't require it.

About

A simple script for exporting comments out of a Drupal 6 database into DISQUS compatible XML files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages