# Import Wordpress comments through Disqus

**URL:** <https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666>\
**Category:** WordPress\
**Created:** [2 أغسطس 2015، 1:35م UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666 "2015-08-02T13:35:22Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![art](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/art/32/116517_2.png) [@art](https://meta.discourse.org/u/art)\
**Post date:** [2 أغسطس 2015، 1:35م UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666/1 "2015-08-02T13:35:22Z")

</div>

Hi,

I try to migrate my WordPress comments to Discourse. I’ve read a lot about that, and I saw I need to transit my comments through Disqus to do that, because imports script don’t work with WP at this time.

I’ve installed Discourse with DigitalOcean and [the 30 min install](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md).

Well, [inspired by this tutorial](http://www.railsonmaui.com/blog/2014/09/27/updating-to-jekyll-2-and-discourse-for-comments/), I’ve tried to import my xml from Disqus. First :

```
$ RAILS_ENV=production bundle exec thor disqus:import --file=irz.xml --post-as=disqus --dry-run
Could not find command "disqus:import".

```

Ok I understand, this don’t work anymore.

```
$ cd /var/www/discourse
$ RAILS_ENV=production bundle exec thor typepad:import --file=irz.xml --post-as=art
Importing 0 entries

```

Well, this don’t work too. So close.

I’ve found another interesting and recent file (update a month ago), [disqus.rb](https://github.com/discourse/discourse/blob/master/script/import_scripts/disqus.rb). Reading the file, I found how to call it :

```
$ cd /var/www/discourse/script/import_scripts
$ RAILS_ENV=production ruby disqus.rb --file=irz.xml --post-as=art --dry_run
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- nokogiri (LoadError)
	from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	from disqus.rb:1:in `<main>'

```

Perhaps I missed something..

I don’t know if [I need to install nogokiri gem](http://stackoverflow.com/questions/28999906/require-cannot-load-such-file-nokogiri-nokogiri-loaderror-when-running) ?

```
$ gem install nokogiri
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/local/lib/ruby/gems/2.0.0 directory.

```

If you have another way to do that, I’ll take it.

---

_[View the full topic](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666)._
