# Migrate a phpBB3 forum to Discourse

**URL:** https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810
**Category:** Migrating to Discourse
**Tags:** how-to
**Created:** [7월 5, 2015, 10:02오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810 "2015-07-05T22:02:57Z")
**Posts on this page:** 20
**Page:** 8

<div class="post-metadata">

### Author: ![DDo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ddo/32/142669_2.png) [@DDo](https://meta.discourse.org/u/DDo)
#### Post date: [8월 16, 2019, 9:38오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/458 "2019-08-16T09:38:53Z")

</div>

After having the importer successfully used on my first testing-environment, I now wanted to import the old forum again / freshly into a new should-become-the-real-environment, but now it failed.

I get an error:  
/var/www/discourse/plugins/discourse-migratepassword/plugin.rb:71:in `crypt’: incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError).

Appearantly this happens oh the third user, and this one is with an umlaut.

Now, what did I change since it worked?

- new VM with Ubuntu 18.04.3 LTS (old was a 16)
- updated Discourse (latest)
- set “unicode usernames” with [äöüßÄÖÜẞ] since loads of my users have Umlauts in their Usernames (first import was without this setting and Users got imported by losing the dots on the umlauts)
- preinstalled migratepassword (last time installed it later).

Any Idea whereon it fails? I’d really like to have my users migrated without having changed usernames.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [8월 16, 2019, 10:16오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/459 "2019-08-16T10:16:29Z")

</div>

Looks like it’s triggering a bug in the migratepassword plugin. It works in my tests, so I’m not sure what’s happening here. I suggest you disable the plugin during the migration. It’s not needed during the migration anyway.

---

<div class="post-metadata">

### Author: ![DDo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ddo/32/142669_2.png) [@DDo](https://meta.discourse.org/u/DDo)
#### Post date: [8월 21, 2019, 9:01오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/460 "2019-08-21T09:01:39Z")

</div>

Thank you - that worked 🙂

---

<div class="post-metadata">

### Author: ![Queth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/queth/32/154753_2.png) [@Queth](https://meta.discourse.org/u/Queth)
#### Post date: [8월 29, 2019, 5:06오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/461 "2019-08-29T17:06:46Z")

</div>

hello, I’m trying to do a testrun on my local environment to see if I can get my forum migrated to discourse.

I used [this install guide](https://meta.discourse.org/t/beginners-guide-to-install-discourse-for-development-using-docker/102009) to install discourse

I have a phpbb3 database export locally.  
I have installed a local discourse on my mac with docker for desktop.

I am now trying to follow the instructions in this topic but I get stuck because I use docker, but not ubuntu, and it is local environment. So I don’t know how to proceed ☹  
there is no app.yml in my discourse directory.

could anyone help me with what steps to take ?

many thanks in advance!

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [8월 29, 2019, 8:29오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/462 "2019-08-29T20:29:09Z")

</div>

I’m sorry, I don’t have any experience with Mac, Docker and your setup. You might be able to roughly follow [Importing using development environment](https://meta.discourse.org/t/importing-from-phpbb3/30810#heading--import-2)… but I can’t really give you any support for this.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [8월 29, 2019, 9:19오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/463 "2019-08-29T21:19:25Z")

</div>

I think you might be better off following the “official installation guide” (even on your local mac) and running the installer that way.

---

<div class="post-metadata">

### Author: ![Queth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/queth/32/154753_2.png) [@Queth](https://meta.discourse.org/u/Queth)
#### Post date: [9월 1, 2019, 1:20오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/464 "2019-09-01T13:20:41Z")

</div>

Hurray, I have successfully done an import!  
In the end, I just decided to get a DO droplet and go from there. And it worked!

Question about sidekiq, @gerhard you say:

> [@gerhard](#):
>
> Discourse will start and _Sidekiq_ will begin post-processing all the imported posts. This can take a considerate amount of time.

What does this do exactly? Do I have to wait until it’s finished before I can do anything in the forum?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [9월 1, 2019, 2:38오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/465 "2019-09-01T14:38:33Z")

</div>

Unless you need to backup to restore to a different server, you’re fine. You can go ahead and use it and sidekiq will process stuff.

---

<div class="post-metadata">

### Author: ![nobodyfrm](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nobodyfrm](https://meta.discourse.org/u/nobodyfrm)
#### Post date: [11월 6, 2019, 1:50오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/466 "2019-11-06T13:50:46Z")

</div>

안녕하세요, 현재 phpBB 3.1 포럼 데이터를 Discourse로 가져오려고 하고 있습니다. 하지만 투표(poll) 가져오기가 제 환경에서는 작동하지 않습니다:

스레드 소유자(투표 생성자)가 삭제된 경우, 가져오기 과정에서 다음과 같은 오류 메시지가 표시됩니다:

Error creating post 70978. Skipping. [“You are not allowed to create polls.”]

다음과 같은 투표 옵션의 경우  
\<12  
12  
\>12  
다음과 같은 오류 메시지를 받습니다:  
Error creating post 345655. Skipping. [“Poll must have different options.”]

이 문제를 어떻게 해결할 수 있을까요?

미리 감사드립니다.

감사합니다

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 6, 2019, 2:24오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/467 "2019-11-06T14:24:24Z")

</div>

투표 기능이 활성화되어 있나요?

---

<div class="post-metadata">

### Author: ![nobodyfrm](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nobodyfrm](https://meta.discourse.org/u/nobodyfrm)
#### Post date: [11월 6, 2019, 2:37오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/468 "2019-11-06T14:37:38Z")

</div>

네, 일부 투표는 가져와지지만 모두 가져와지지는 않습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 6, 2019, 2:41오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/469 "2019-11-06T14:41:48Z")

</div>

> [@nobodyfrm](#):
>
> 쓰레드 소유자(투표 생성자)가 삭제된 경우, 가져오기 과정에서 다음과 같은 오류 메시지가 표시됩니다:

해당 사용자가 존재하지 않는 경우, 해당 사용자를 생성하거나 스크립트를 수정하여 'system’을 사용하도록 설정해야 합니다.

---

<div class="post-metadata">

### Author: ![nobodyfrm](https://avatars.discourse-cdn.com/v4/letter/n/e0b2c6/32.png) [@nobodyfrm](https://meta.discourse.org/u/nobodyfrm)
#### Post date: [11월 6, 2019, 2:48오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/470 "2019-11-06T14:48:04Z")

</div>

삭제된 사용자의 일반 스레드는 정상적으로 가져옵니다. 삭제된 사용자의 투표도 함께 가져오도록 가져오기 스크립트를 어떻게 수정해야 할까요?

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [11월 23, 2019, 8:07오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/471 "2019-11-23T08:07:18Z")

</div>

현재 phpBB에서 Discourse로의 이주를 처음 시도하고 있습니다. 나중에 Discourse 백업을 이전하면, phpBB에서 가져온 모든 메타 정보(예: phpBB의 원본 게시글 ID)가 포함되는지 궁금합니다. 이유는 더 큰 용량의 머신에서 이주를 수행하여 속도를 높이고, 이후 포럼을 VPS에서 운영하면서 VPS로 모든 것을 옮긴 후 추가적인 증분 이주를 진행할 수 있기 때문입니다. Discourse 백업/재가져오기만으로도 충분한지, 아니면 DB를 다른 방식으로 덤프하는 것이 더 나은지(어떤 방식으로?) 궁금합니다.

그리고 한 가지 더 질문이 있습니다: 가져오기 도구의 URL 재작성(importer의 URL rewrite)은 이후 도메인 변경 시에도 안전한가요? 초기 이주에는 다른 도메인 또는 서브도메인을 사용하고, 나중에 실제 도메인으로 전환할 계획이었습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 23, 2019, 11:52오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/472 "2019-11-23T11:52:34Z")

</div>

네, 백업에는 커스텀 필드에 원본 게시글 ID가 포함되어 있습니다. 클라우드에서 최종 가져오기를 실행하는 데는 문제가 없을 것입니다.

호스트명을 변경하려면 약간의 작업이 필요합니다. [Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098)

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [11월 23, 2019, 7:25오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/473 "2019-11-23T19:25:05Z")

</div>

첫 번째 테스트 마이그레이션을 마쳤고, 그 전에 먼저 이 작업에 기여해 주신 @gerhard님과 다른 모든 분들에게 감사의 말씀을 전하고 싶습니다. 첫 시도에 이렇게 잘 작동한 것이 정말 놀랍습니다. 사용자, 개인 메시지 및 기타 데이터를 포함하여 약 90만 개의 게시물을 가져오는 데 약 24시간이 걸렸고, 첫 시도치고는 결과가 매우 좋습니다. 이렇게 훌륭한 가져오기(importer) 도구를 이용해 작업을 완료할 수 있다는 것은 정말 멋진 일입니다.

다만 몇 가지 문제가 있는데, 현재 가장 중요하게 추적 중인 문제는 일부 내부 링크가 완전히 잘못되었고, 다른 일부는 꽤 잘 작동했다는 점입니다. 더 정확히 말하면, 잘못된 것보다 제대로 된 링크가 훨씬 더 많은 것 같습니다. 어떤 링크가 작동하지 않았는지 패턴을 찾아가고 있습니다. 이 내부 링크 변경이 어떻게 작동하는지에 대한 통찰을 공유해 주실 수 있을까요? 실패할 수 있는 함정이 있을 수도 있나요?

참고: 가져오기 직후 인용문에서 모든 아바타가 누락된 것을 보았지만, 아바타가 생성되는 것 같았고 20분 정도 후에는 모든 것이 정상으로 돌아왔습니다. 정말 신기하네요 😉

가져오기 시간 관련: Hetzner 4코어 VPS(전용 CPU 코어)에서 진행했습니다. 마이그레이션 시간을 단축하기 위해 가져오기 작업만은 베어 메탈 서버에서 다시 시도해 볼 계획입니다. 먼저 Discourse 백업 이동을 어떻게 진행해야 하는지 확인이 필요합니다.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [11월 24, 2019, 10:24오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/474 "2019-11-24T22:24:49Z")

</div>

내부 링크를 대체하는 코드는 여기에 있습니다: [discourse/script/import\_scripts/phpbb3/support/text\_processor.rb at 43ddf60cdf27a865b7b1aa0d54a144a3e46c74cf · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/43ddf60cdf27a865b7b1aa0d54a144a3e46c74cf/script/import_scripts/phpbb3/support/text_processor.rb#L73-L114)

게시글이 아직 가져오지 않은 다른 게시글에 대한 링크를 포함하고 있는 경우, 내부 링크 재작성이 실패합니다. 게시글은 원래 생성 순서대로 가져옵니다.

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [11월 25, 2019, 7:25오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/475 "2019-11-25T07:25:11Z")

</div>

흥미로운 힌트네요. 제가 확인한 몇 가지 사례에서는 왜 그런 일이 발생했는지 이해가 안 되지만, 그 방향으로 definitely 시도해 볼 예정입니다. 이상한 점은 제 경우엔 잘못된 게시글이 링크된다는 거예요. 실패할 경우 아무 동작도 안 하거나 링크를 그대로 두길 기대했는데, 불행히도 제 루비 지식은 거의 제로에 가깝지만 그래도 코드를 한번 살펴볼게요.

이 문제를 우회할 방법이 있을까요? 튜토리얼 스타일의 게시글은 여러 번 수정되고 보완되면서 링크가 추가되는 경우가 많아서 이런 일이 자주 발생할 것 같아요. 해당 게시글을 수동으로 변경하는 것 외에 다른 우회 방법이 있을까요?

도움 주셔서 감사합니다! 👍

---

<div class="post-metadata">

### Author: ![helmi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/helmi/32/114772_2.png) [@helmi](https://meta.discourse.org/u/helmi)
#### Post date: [11월 25, 2019, 7:43오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/476 "2019-11-25T19:43:45Z")

</div>

음, 방금 사용자 그룹이 가져오지지 않았다는 걸 발견했고, 여기 첫 번째 게시물에도 목록에 없는데, 가져오기 도구에서는 실제로 가장 먼저 표시되는 항목 중 하나입니다. 사용자들을 해당 그룹에 연결하는 방식으로 가져올 수 있는 방법이 있는지, 아니면 아직 기능이 작동하지 않는 건지 궁금합니다. 후자의 경우 우회책을 찾아야 할 것 같습니다.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 25, 2019, 8:30오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/477 "2019-11-25T20:30:37Z")

</div>

> [@helmi](#):
>
> 이상한 점은 제 경우엔 잘못된 게시글에 링크가 걸린다는 겁니다.

네. 정말 이상하네요. 이는 로컬 링크 중 일부가 가져오기 스크립트가 기대하는 형식과 다른 형식으로 되어 있어, 정규 표현식(regex)이 잘못된 게시글을 찾도록 유도한다는 것을 시사합니다. 누군가 과거에 존재하지 않았던 게시글을 가리키도록 게시글을 수정했다면(그렇다는 것을 확인하셨나요?), 처음 게시글을 작성할 때 스크립트를 혼란스럽게 만든 다른 방식으로 링크를 만들었을 수 있습니다.

각 가져오기 작업(특히 성숙한 포럼의 경우)이 얼마나 개별적이고 고유한지 놀랍습니다. 가져오기 작업이 단순히 스크립트를 실행하는 것으로 끝나는 경우는 꽤 드뭅니다(하지만, 가져오기에 복잡성이 있을수록 사람들이 저를 고용할 가능성이 더 높아지겠죠).

[이전 페이지](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810.md?page=7)

[다음 페이지](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810.md?page=9)
