# Import Wordpress comments through Disqus

**URL:** https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666
**Category:** WordPress
**Created:** [August 2, 2015, 1:35pm UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666 "2015-08-02T13:35:22Z")
**Posts on this page:** 4
**Page:** 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: [August 2, 2015, 1:35pm 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.

---

<div class="post-metadata">

### Author: ![omfg](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@omfg](https://meta.discourse.org/u/omfg)
#### Post date: [August 2, 2015, 2:52pm UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666/2 "2015-08-02T14:52:01Z")

</div>

Enter Docker as “root” and you’ll have the permissions you need.

---

<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: [August 3, 2015, 7:22pm UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666/3 "2015-08-03T19:22:16Z")

</div>

Yep, thank you @omfg.

This command working :

```
$ cd /var/www/discourse/script/import_scripts
$ RAILS_ENV=production ruby disqus.rb --file=irz.xml --post_as=art

```

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 4, 2015, 7:36pm UTC](https://meta.discourse.org/t/import-wordpress-comments-through-disqus/31666/4 "2015-08-04T19:36:06Z")

</div>

This topic was automatically closed after 22 hours. New replies are no longer allowed.
