# Migrate a NodeBB forum with MongoDB to Discourse

**URL:** https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553
**Category:** Sysadmins
**Tags:** how-to
**Created:** [August 22, 2019, 5:33pm UTC](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553 "2019-08-22T17:33:06Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 2, 2026, 8:04am UTC](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553/22 "2026-03-02T08:04:35Z")

</div>

> [@Twissell](#):
>
> `return nil if post.nil?`

Tip: don’t make it fail completely silently - change this into

```plaintext
if post.nil?
  puts "!!! Could not find post #{id}"
  return nil
end

```

Or you will end up wondering why half your posts is missing and after hours of frustration it turns out to be this.

same for these two

```plaintext
        next if post.nil?
        next if post["deleted"] == "1"

```

---

_[View the full topic](https://meta.discourse.org/t/migrate-a-nodebb-forum-with-mongodb-to-discourse/126553)._
