Ability to move Disqus comments into the comment module's table for backing up or migration from Disqus to comment module.


RobLoach’s picture

The module should be called disqus_migrate.module (or something), which should allow two things:

  1. Import: Allows you to download the Disqus comments and import them into Drupal's comment module. This would require syncing, making sure no duplicates are added. You also have the ability to schedule this with the cron.
  2. Export: Allows you to upload comments from Drupal's comment module to Disqus. It would track which comments were sent, making sure no duplicates on Disqus are made. You also have the ability to schedule this with the cron.
krishaamer’s picture

Subscribing. If someone could do this it would tilt the scales in against anything else out there.

CSCharabaruk’s picture

Also subscribing.

shadyman@erroraccessdenied.com’s picture

Definitely a great idea. Subscribing.

njehlen’s picture


RobLoach’s picture

I just committed the ability to import comments from Disqus to Drupal:

JeremyL’s picture

Any plans or ETA on when the Export from Drupal to Disqus could be implemented?

JordanMagnuson’s picture

I'm also wondering about exporting comments from drupal into disqus... ETA?? Seems like a key feature for anyone with an already-developed website.

Thanks for any answers. This looks like a great module, if I could just import my existing comments.

Chad_Dupuis’s picture

+1 for the export - subscribing

pointsi’s picture

Waiting on the ability to export comments from Drupal into Disqus as well...

calshei1’s picture

Me too. Would love to be able to import old Drupal comments into the Disqus system.

TheRuslan’s picture


RobLoach’s picture

Title: Backup Disqus comments using Disqus Migrate Export » Migrate from Drupal comment.module to Disqus comments

More meaningful title.

superflyman’s picture

I concur, would very much like to be able to import old comments. Unless implementing on a brand new site, quite a bit of dialogue can be lost. Basically, that was just a long way of saying 'subscribing'...

RobLoach’s picture

Status: Active » Needs work
2.78 KB


mikehostetler’s picture


robphillips’s picture

Status: Needs work » Needs review
4.8 KB
6.2 KB

Attached is a *working* export patch. It adds the ability to export Drupal comments to any of your Disqus forums (including or excluding unapproved Drupal comments). It stores the export results in a table {disqus_migrate_export} to prevent duplicate comments from being exported; it also allows the API to fail but pick back up where it last was in the export.

Apply the patch inside the migrate_disqus folder. There is also a pre-patched version of the migrate module attached. Enjoy!

NOTE: I would randomly get unmarked API errors during certain test runs (only occurred on 1 or 2 tests), however this appears just to be an API problem because the export picks back up the next run. No threads or comments were missed when these errors occurred (tested on a site with about 40 threads and 200 comments). For sites with large amount of comments PHP will *probably* time out before it gets done, for now you can simply reload the page after the time out and click export again to pick up at the last comment. Eventually it would be nice to have a more graceful batch style export to avoid PHP time outs all together (maybe it's not a big deal though since it's a one-time operation usually).

P.S: To the module maintainer, ImageX Media would love to be credited for this work on the project page. Our company page is http://drupal.org/profile/companies/ImageX%20Media (http://imagexmedia.com). Thanks!!

fiLi’s picture


Canine Coaches’s picture


RobLoach’s picture

Why isn't this working with the Batch API?

CinemaSaville’s picture

I'm getting this error when I try to export comments-
user warning: Table 'database.disqus_migrate_export' doesn't exist query: SELECT c.*, u.mail as user_mail, n.title as node_title FROM comments c INNER JOIN users u ON u.uid = c.uid INNER JOIN node n ON n.nid = c.nid LEFT JOIN disqus_migrate_export d ON d.cid = c.cid AND d.fid = 320046 WHERE d.did IS NULL AND c.status IN (0) ORDER BY c.timestamp ASC in /home/public_html/sites/all/modules/disqus/disqus_migrate.admin.inc on line 138.

RobLoach’s picture

You'll probalby have to reinstall the Disqus Migrate module after applying the patch.

RobLoach’s picture

Status: Needs review » Fixed

I'm committing this one... http://drupal.org/cvs?commit=348370

We can worry about Batch API later on if anyone wants to help out with that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

richard.c.allen2386’s picture

Category: feature » support
Status: Closed (fixed) » Active
Issue tags: +migrate, +disqus

I recently installed the disqus module and applied the patch from post #17 located here http://drupal.org/node/269010#comment-2756308 after having uninstalled and re-installing the module. After clicking on the export tab all I receive is a blank page. Has anyone run in to this issue? What can I do to trouble shoot this?

petermallett’s picture

Now that this issue is re-opened, I'll mention this here too. We tried the same thing with similar results, and I'd already been trying to create a comment export module on my own, so I finished that up. Maybe give it a shot? So far it's working for all our tests.

RobLoach’s picture

Status: Active » Closed (duplicate)

LEt's move people over to #777842: Uncaught DisqusException on export instead.

  • Commit b8c186a on 6.x-1.x, 7.x-1.x, 8.x-1.x by RobLoach:
    #269010: Ability to import from Disqus.
  • Commit 2979109 on 6.x-1.x, 7.x-1.x, 8.x-1.x by RobLoach:
    #269010: Remove debug information.