# 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:** 22

<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: [3월 7, 2024, 1:38오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/757 "2024-03-07T13:38:22Z")

</div>

좋아요! 해결한 것 같아 기뻐요. 어떤 부분이 핵심이었나요?

아마 이 서비스는 필요하지 않으실 거예요: [Discourse Migration - Literate Computing](https://www.literatecomputing.com/services/discourse-migration/)

---

<div class="post-metadata">

### Author: ![Scott\_Darnell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_darnell/32/364360_2.png) [@Scott\_Darnell](https://meta.discourse.org/u/Scott_Darnell)
#### Post date: [3월 7, 2024, 9:49오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/758 "2024-03-07T21:49:49Z")

</div>

모든 카테고리가 가져와질 때까지 import\_phpbb3.sh 스크립트를 계속 실행해야 했습니다. 스크립트가 밤새도록 실행되었고, 네트워크 단절로 인해 제 쪽에서 일부 오류가 발생했습니다. 스크립트를 다시 시작했는데, 지금은 정상적으로 작동하는 것 같습니다. 추가적인 문제가 발생하면 MySQL 테이블에 직접 들어가서 데이터를 정리해야 할 것 같습니다.

---

<div class="post-metadata">

### Author: ![Scott\_Darnell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_darnell/32/364360_2.png) [@Scott\_Darnell](https://meta.discourse.org/u/Scott_Darnell)
#### Post date: [3월 9, 2024, 7:20오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/759 "2024-03-09T19:20:24Z")

</div>

모두 안녕하세요! 포럼이 거의 정상적으로 작동하고 있습니다… 정말 멋져 보입니다. [/quote] 태그를 수정하기 위한 스크립트를 작성 중입니다. 이 보드는 2001년으로 거슬러 올라가는 꽤 오래된 시스템인데, 닫는 태그 위아래에 공백을 하나씩만 추가해도 많은 문제를 해결할 수 있습니다. 가져오기(import) 스크립트에서 업데이트할 수 있는 설정이 있었을 텐데, 처음 이주(migration)를 하는 중이라면서 진행하면서 배우고 있습니다.

**질문:** 10년 치 데이터를 수정 중이며, 현재 실행 중인 phpBB 보드가 있습니다. 시간이 좀 걸립니다. import\_phpbb3.sh 스크립트를 사용하여 포럼의 마지막 X일치 게시물을 가져올 수 있을까요? 스크립트 입장에서는 단순히 병합(merge) 작업일 것 같습니다. MySQL에서 마지막 7일치 데이터를 내보낼(export) 수는 있지만, 그것이 작동할지는 알지 못합니다. 의견이 있으신가요?

스크립트가 제대로 작동하는지 아직 확인하지 않았습니다… 작은 부분에서는 테스트했지만, 배치(batch) 처리는 테스트하지 않았습니다. 제가 겪었던 문제는 닫는 태그 위아래의 공백이었습니다. 이제 잔디를 깎으러 나갔다가 나중에 돌아와서 다시 확인하겠습니다:

```plaintext
batch_size = 1000
total_processed = 0

# Process posts across the entire site in batches
Post.find_in_batches(batch_size: batch_size) do |batch|
  updated_posts = []

  batch.each do |post|
    original_raw = post.raw
    # Apply the correction
    new_raw = original_raw.gsub(/\n\\n\[\/quote\]\\n\n\n/, "\n\n[/quote]\n\n")

    if original_raw != new_raw
      post.update_column(:raw, new_raw) # Direct column update to skip callbacks
      updated_posts << post
      total_processed += 1
    end
  end

  # Rebake only the updated posts to minimize load
  updated_posts.each(&:rebake!)

  puts "Processed a batch of #{batch.size}. Total processed so far: #{total_processed}."
end

puts "Total #{total_processed} posts processed across the entire site."

```

---

<div class="post-metadata">

### Author: ![Scott\_Darnell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_darnell/32/364360_2.png) [@Scott\_Darnell](https://meta.discourse.org/u/Scott_Darnell)
#### Post date: [3월 9, 2024, 7:21오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/760 "2024-03-09T19:21:35Z")

</div>

이 방법은 개별 게시물에 적용되었습니다:

post = Post.find(344572) # 344572를 올바른 ID로 교체

post.raw = post.raw.gsub(/\n\n[/quote]\n\n\n/, “\n\n[/quote]\n\n”)

---

<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: [3월 9, 2024, 8:05오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/761 "2024-03-09T20:05:31Z")

</div>

> [@Scott\_Darnell](#):
>
> 개별 게시물에서는 이 방법이 작동했습니다:

데이터를 가져올 때 이 작업을 수행하도록 스크립트를 수정하겠습니다. 이미 그렇게 되어 있지 않은 것이 놀랍습니다. 상황을 좀 더 자세히 살펴볼 가치가 있습니다.

> [@Scott\_Darnell](#):
>
> `import_phpbb3.sh` 스크립트를 사용하여 포럼의 최근 X일치 게시물만 가져올 수 있을까요?

제가 작업한 여러 스크립트에서는 `IMPORT_AFTER` 환경 변수를 추가하고 쿼리를 수정하여 `where some_timestamp > import_after_data`를 포함시켰습니다. 이 스크립트에는 그런 옵션이 없는 것 같지만, 자세히 살펴본 것은 아닙니다.

하지만 주의할 점은, 10년 전 데이터에 있는 내용과 최근 2년치 내용이 다를 가능성이 높다는 것입니다. 따라서 모든 곳에 존재하는 것으로 알려진 문제를 디버깅하기 위해 최근 데이터만 테스트하는 것은 훌륭하지만, 전체 데이터베이스에서도 테스트하는 것이 좋습니다.

---

<div class="post-metadata">

### Author: ![Scott\_Darnell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_darnell/32/364360_2.png) [@Scott\_Darnell](https://meta.discourse.org/u/Scott_Darnell)
#### Post date: [3월 9, 2024, 8:44오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/762 "2024-03-09T20:44:52Z")

</div>

여러 가지 다른 요소가 뒤섞여 있습니다. 가져오기는 약 99% 완료되었어요… 지난 주 게시글만 다시 가져오면 됩니다 🙂 줄바꿈이 추가되고 이 문제가 수정되면 \<LINK\_TEXT text= 모든 것이 잘 될 거예요 🙂

---

<div class="post-metadata">

### Author: ![Scott\_Darnell](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scott_darnell/32/364360_2.png) [@Scott\_Darnell](https://meta.discourse.org/u/Scott_Darnell)
#### Post date: [3월 10, 2024, 9:39오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/763 "2024-03-10T21:39:09Z")

</div>

PhpBB에서 넘어온 사용자를 위해 AI로 설명을 작성해서 붙여넣었습니다. 이 작업을 하느라 새벽 5시까지 깨어 있었습니다. 😂😂😂

Discourse 환경에서 포럼 주제를 1,000개씩 배치로 처리하고, 해당 주제 내 각 게시글에 특정 변환을 적용하는 Ruby 스크립트를 실행하려면 서버에 접속하고 적절한 환경에 진입한 뒤 스크립트를 실행하는 일련의 단계를 따라야 합니다. 스크립트 자체를 포함한 상세 가이드는 다음과 같습니다:

### 1단계: 서버에 안전하게 연결하기

PuTTY(Windows용)와 같은 Secure Shell(SSH) 클라이언트를 사용하여 Discourse 포럼이 호스팅된 서버에 연결합니다. 서버의 IP 주소 또는 도메인 이름과 자격 증명(사용자 이름과 비밀번호 또는 SSH 키)이 필요합니다.

### 2단계: Discourse Docker 컨테이너에 접근하기

서버에 로그인한 후, 일반적으로 `/var/discourse`에 위치하는 Discourse 설치 디렉토리로 이동합니다. 그런 다음 다음 명령을 사용하여 Discourse를 실행하는 Docker 컨테이너에 진입합니다:

bash

```plaintext
cd /var/discourse
./launcher enter app

```

### 3단계: Rails 콘솔 열기

Docker 컨테이너 내부에서 Rails 콘솔을 통해 Discourse 애플리케이션과 상호작용할 수 있습니다. 이는 Discourse 데이터베이스와 애플리케이션 로직에 대해 Ruby 코드를 직접 실행할 수 있는 Ruby on Rails 환경입니다. 다음 명령으로 콘솔을 시작합니다:

bash

```plaintext
rails c

```

### 4단계: Ruby 스크립트 실행

Rails 콘솔이 열리면 Ruby 스크립트를 실행할 준비가 완료됩니다. 스크립트는 미리 준비하여 클립보드에 복사해 두어야 합니다. PuTTY에서는 마우스 오른쪽 버튼을 클릭하거나 Shift + Insert 키를 눌러 스크립트를 붙여넣을 수 있습니다.

사용하게 될 전체 스크립트는 다음과 같습니다:

code

```plaintext
# 모든 주제 ID의 배열 가져오기
topic_ids = Topic.pluck(:id)

# 배치 크기 정의
batch_size = 1000
current_batch_start = 0

while current_batch_start < topic_ids.length
  # 한 번에 1,000개의 주제 배치 처리
  topic_ids[current_batch_start, batch_size].each do |topic_id|
    # ID로 주제 가져오기
    topic = Topic.find(topic_id)
  
    # 주제가 nil인 경우 건너뛰기
    next if topic.nil?
  
    # 현재 주제에 대해 변환된 게시글 개수 초기화
    transformed_count = 0

    # 주제 내 각 게시글 반복
    topic.posts.each do |post|
      # 변환이 수행되었는지 추적하는 플래그
      transformed = false

      # 변환 적용
      transformed |= post.raw.gsub!(/<\/?r>/, '').present?
      transformed |= post.raw.gsub!(/<\/?s>/, '').present?
      transformed |= post.raw.gsub!(/<\/?e>/, '').present?
      transformed |= post.raw.gsub!(/<\/?QUOTE[^>]*>/, '').present?
      transformed |= post.raw.gsub!(/\[quote=““([^”]+)””\]/, '[quote="\1"]').present?
      transformed |= post.raw.gsub!(/\\n/, "\n").present?
      transformed |= post.raw.gsub!(/\[quote=([^\s]+)\s+post_id=\d+\s+time=\d+\s+user_id=\d+\]/, '[quote="\1"]').present?
      transformed |= post.raw.gsub!(/<URL url="([^"]+)">.*?<LINK_TEXT text="[^"]+">[^<]+<\/LINK_TEXT>.*?<\/URL>/, '\1').present?
      transformed |= post.raw.gsub!(/\[\/quote\]/, "\n[/quote]\n").present?
      transformed |= post.raw.gsub!(/\A\n/, '').present?

      # 변환이 발생한 경우 게시글 저장 및 재베이킹
      if transformed
        post.save!
        post.rebake!
        transformed_count += 1
      end
    end

    # 현재 주제에 대한 결과 출력
    if transformed_count > 0
      puts "주제 #{topic_id}에서 #{transformed_count}개의 게시글을 변환했습니다."
    else
      puts "주제 #{topic_id}에는 변환이 필요하지 않았습니다."
    end
  end

  # 다음 배치를 위한 시작 인덱스 업데이트
  current_batch_start += batch_size

  # 처리할 주제가 더 있는지 확인
  if current_batch_start < topic_ids.length
    puts "#{batch_size}개 주제 배치 완료. 다음 배치로 계속하시겠습니까? (yes/no)"
    response = gets.strip.downcase
    break unless response == 'yes'
  end
end

```

### 스크립트 및 배치 처리 이해하기

- **배치 처리:** 이 접근 방식은 대량의 데이터를 더 작고 관리 가능한 청크로 처리할 수 있게 합니다. 이는 서버 부하를 줄이고, 한 번에 수행할 경우 긴 시간이 소요될 수 있는 작업에 특히 유용합니다. 여기서는 Discourse 주제를 1,000개씩 배치로 처리하는 데 적용됩니다.

실행 중 다음과 같은 모습을 보여야 합니다.

```plaintext
주제 19556에는 변환이 필요하지 않았습니다.
주제 35766에는 변환이 필요하지 않았습니다.
주제 35783에는 변환이 필요하지 않았습니다.
주제 35778에는 변환이 필요하지 않았습니다.
주제 35774에는 변환이 필요하지 않았습니다.
주제 35770에는 변환이 필요하지 않았습니다.
주제 20234에서 292개의 게시글을 변환했습니다.
주제 35781에는 변환이 필요하지 않았습니다.
주제 35779에는 변환이 필요하지 않았습니다.
주제 20218에서 242개의 게시글을 변환했습니다.
주제 19522에서 22개의 게시글을 변환했습니다.
주제 35771에는 변환이 필요하지 않았습니다.
주제 35767에는 변환이 필요하지 않았습니다.
주제 22560에서 2개의 게시글을 변환했습니다.
주제 35797에는 변환이 필요하지 않았습니다.
주제 35789에는 변환이 필요하지 않았습니다.
주제 35785에는 변환이 필요하지 않았습니다.
주제 31889에는 변환이 필요하지 않았습니다.
주제 31831에서 1개의 게시글을 변환했습니다.
주제 31792에는 변환이 필요하지 않았습니다.
주제 35794에는 변환이 필요하지 않았습니다.
주제 35815에는 변환이 필요하지 않았습니다.

```

- **스크립트 기능:** 이 스크립트는 Discourse 데이터베이스에서 가져온 각 주제 ID를 반복하며, 해당 주제 내 각 게시글에 지정된 변환을 적용합니다.

---

<div class="post-metadata">

### Author: ![Carleas](https://avatars.discourse-cdn.com/v4/letter/c/57b2e6/32.png) [@Carleas](https://meta.discourse.org/u/Carleas)
#### Post date: [3월 27, 2024, 2:06오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/764 "2024-03-27T14:06:51Z")

</div>

> [@DDo](#):
>
> /var/www/discourse/plugins/discourse-migratepassword/plugin.rb:71:in `crypt’: incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError).

사용자의 표시 이름(display name, 사용자 이름이 아님)에 특수 문자를 포함하도록 변경하려고 할 때 이 오류가 발생합니다(이전 마이그레이션 후, 정상 작동하는 표준 설치 환경에서). 시도할 때 `internal server error`(내부 서버 오류) 팝업이 표시되고, 로그에는 @DDo 님이 겪었던 것과 동일한 오류가 기록됩니다.

특이한 점은 다른 사용자들은 동일한 문자(™)를 포함하여 표시 이름을 변경할 수 있다는 것입니다. 관련되는 차이점은 마이그레이션 후 로그인한 사용자는 UTF-8 문자를 사용할 수 있지만, 로그인하지 않은 사용자는 ASCII-8BIT만 사용할 수 있는 것 같습니다.

또한 `discourse-migratepassword` 플러그인을 제거하면 이 오류가 해결될 것이라고 가정하지만, 아직 테스트해 보지는 않았습니다.

이것은 버그인가요, 아니면 해당 플러그인을 작동시키기 위한 본질적인 문제인가요? 전자라면 Github에서 이슈를 생성하여 보고하는 것이 가장 좋은 방법인가요?

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [4월 20, 2024, 2:12오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/765 "2024-04-20T14:12:14Z")

</div>

음, import 컨테이너를 (재)빌드하려고 하는데 실패합니다:

```plaintext
FAILED
--------------------
Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/service/unicorn/run
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/replace_command.rb:11:in `read'
replace failed with the params {"tag"=>"precompile", "filename"=>"/etc/service/unicorn/run", "from"=>"PRECOMPILE_ON_BOOT=1", "to"=>"PRECOMPILE_ON_BOOT=0"}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

```

이미 모든 플러그인을 비활성화했지만, 아무런 변화가 없습니다.

혹시 아이디어가 있는 분 계신가요?

---

<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: [4월 20, 2024, 3:20오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/766 "2024-04-20T15:20:05Z")

</div>

> [@Roi](#):
>
> ` 위로 스크롤하여 이전의 오류 메시지를 찾아보세요`

그러니까 그게 첫 번째 아이디어입니다.

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [4월 20, 2024, 3:52오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/767 "2024-04-20T15:52:25Z")

</div>

네, 에러를 나타내거나 알려주는 것을 찾지 못했어요… 한 번 더 확인해볼게요…

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [4월 20, 2024, 4:01오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/768 "2024-04-20T16:01:18Z")

</div>

```plaintext
hooks:
  after_web_config:
    - exec:
        cd: /etc/service
        cmd:
        # - rm -R unicorn
          - rm -R nginx
          - rm -R cron

```

`templates/import/phpbb3.template.yml` 파일에서 `- rm -R unicorn` 줄을 주석 처리했는데, 이제 에러 없이 빌드가 통과되었습니다.

여기서 무슨 일이 일어난 건가요? `phpbb3.template.yml`은 GitHub에서 가져온 2년 전 버전입니다. 그렇다면 어딘가에 다른 변경 사항이 있어야 하는 거 아닌가요?!?

---

<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: [4월 20, 2024, 4:11오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/769 "2024-04-20T16:11:33Z")

</div>

아마도 Ubuntu에서 Debian으로 전환하기 이전부터 존재해 온 것일 수 있습니다. 그런 것들은 누군가 더 이상 작동하지 않는다는 것을 알아차릴 때까지 업데이트되지 않는 경우가 많습니다.

그 `rm` 명령이 문제가 되었다는 건 내게는 좀 이해가 안 되지만, 누군가가 돈을 주지 않는 한 그런 데에 크게 신경 쓰지는 않습니다. 그리고 돈을 주더라도 그 부분에 대해 크게 신경 쓴 기억은 없어요. 🙂

---

<div class="post-metadata">

### Author: ![Roi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roi/32/130587_2.png) [@Roi](https://meta.discourse.org/u/Roi)
#### Post date: [4월 20, 2024, 4:38오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/770 "2024-04-20T16:38:10Z")

</div>

빌더가 /etc/service/unicorn/run 파일이 없다는 점을 지적하고, 실제로 그 파일이 제거된 상태라면, 해당 제거 명령을 주석 처리해 보았습니다. 😉 성공적이었습니다.

모든 것에 대해 더 많은 지식을 가진 누군가가 GitHub에서 스크립트를 확인하고 업데이트를 해주기를 바랍니다. PR을 만들 수도 있지만, 모든 것에 대한 지식이 부족하기 때문에 그렇게 하기를 원하지 않습니다.

하지만 Ubuntu에서 Debian으로 전환하는 것은 많은 것을 변경시키므로, 맞는 말입니다.

---

<div class="post-metadata">

### Author: ![GeoffSchultz](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@GeoffSchultz](https://meta.discourse.org/u/GeoffSchultz)
#### Post date: [9월 4, 2024, 5:39오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/771 "2024-09-04T17:39:03Z")

</div>

우선 저는 Docker 초보자인데, 뭔가 잘못 설정한 것일 수도 있습니다.

DigitalOcean Droplet에 Ubuntu 22.04를 실행 중이며, 사전 구축된 앱을 사용하여 Discourse를 깨끗하게 설치했습니다. 포럼은 정상적으로 구축되었고 표준 구성으로 실행되고 있습니다.

/var/discourse/launcher rebuild import를 실행하면 빌드의 마지막에 다음과 같은 메시지가 표시됩니다:

```plaintext
Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/service/unicorn/run
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/replace_command.rb:11:in `read'
replace failed with the params {"tag"=>"precompile", "filename"=>"/etc/service/unicorn/run", "from"=>"PRECOMPILE_ON_BOOT=1", "to"=>"PRECOMPILE_ON_BOOT=0"}
bootstrap failed with exit code 1
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

```

/var/discourse/launcher enter import를 실행하면 다음과 같은 결과가 나옵니다:

```plaintext
86_64 arch detected.
Error response from daemon: No such container: import

```

이것은 이 게시글 상단의 오류 때문인가요(그렇다면 어떻게 수정해야 하나요), 아니면 제가 무엇을 잘못하고 있는 건가요?

---

<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월 4, 2024, 11:59오후 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/772 "2024-09-04T23:59:59Z")

</div>

지시사항(아마도)에 따라 import.yml을 생성하고 해당 컨테이너를 부트스트랩하셨나요?

---

<div class="post-metadata">

### Author: ![GeoffSchultz](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@GeoffSchultz](https://meta.discourse.org/u/GeoffSchultz)
#### Post date: [9월 5, 2024, 2:34오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/773 "2024-09-05T02:34:29Z")

</div>

설치 지침에는 app.yml을 import.yml로 복사하고 import.yml에 "templates/import/phpbb3.template.yml"을 추가하라고 되어 있습니다(이 부분은 이미 수행했습니다). 그런 다음 import를 다시 빌드하면 제 첫 번째 게시글에 언급된 오류가 발생합니다. bootstrap(?)을 생성하는 방법에 대한 지침이 어디에 있는지 도무지 알 수 없습니다.

설치 지침은 꽤 간단해서 무엇이 잘못되고 있는지 혼란스럽습니다.

```plaintext
# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81a2f335fd01 local_discourse/app "/sbin/boot" 14 hours ago Up 11 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp app

```

---

<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월 5, 2024, 2:43오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/774 "2024-09-05T02:43:22Z")

</div>

죄송합니다. Rebuild는 부트스트랩을 수행합니다. 완료된 후 import 컨테이너가 실행 중이었습니다.

아, 정말 죄송합니다. 이전에 무슨 일이 일어나고 있었는지 제대로 파악하지 못했습니다. phpbb3 템플릿이 최근 discourse\_docker의 변경 사항과 호환되지 않는 것 같습니다. 하지만 제 핸드폰에서는 이 정도밖에 알 수 없습니다.

phpbb3 템플릿에서 "/etc/service/unicorn/run"를 삭제하는 한 줄을 지우면 빌드가 완료될 수 있을 것 같습니다.

---

<div class="post-metadata">

### Author: ![GeoffSchultz](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@GeoffSchultz](https://meta.discourse.org/u/GeoffSchultz)
#### Post date: [9월 5, 2024, 10:35오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/775 "2024-09-05T10:35:22Z")

</div>

Jay, 이 문제에 대한 답변에 감사합니다. 이제 빌드가 정상적으로 완료됩니다.

다음 문제: import\_phpbb3.sh를 실행하면 다음과 같은 오류가 발생합니다:

```plaintext
The phpBB3 import is starting...

/usr/local/lib/ruby/3.3.0/psych/parser.rb:62:in `_native_parse': (<unknown>): did not find expected key while parsing a block mapping at line 3 column 1 (Psych::SyntaxError)
        from /usr/local/lib/ruby/3.3.0/psych/parser.rb:62:in `parse'
        from /usr/local/lib/ruby/3.3.0/psych.rb:455:in `parse_stream'
        from /usr/local/lib/ruby/3.3.0/psych.rb:399:in `parse'
        from /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/compile_cache/yaml.rb:129:in `strict_load'
        from /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/compile_cache/yaml.rb:186:in `input_to_storage'
        from /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/compile_cache/yaml.rb:232:in `fetch'
        from /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/compile_cache/yaml.rb:232:in `load_file'
        from /var/www/discourse/script/import_scripts/phpbb3/support/settings.rb:10:in `load'
        from script/import_scripts/phpbb3.rb:20:in `<module:PhpBB3>'
        from script/import_scripts/phpbb3.rb:16:in `<module:ImportScripts>'
        from script/import_scripts/phpbb3.rb:15:in `<main>'

```

settings.yml 파일의 어떤 부분이 문제인 것 같습니다. 어디서 문제가 발생하는지 어떻게 알 수 있을까요?

```plaintext
database:
  type: MySQL # currently only MySQL is supported
  host: localhost
  port: 3306
  username: 
  password: 
  schema: phpbb
  table_prefix: phpbb_ # Change this, if your forum is using a different prefix. Usually all table names start wi
th phpbb_
  batch_size: 1000 # Don't change this unless you know what you're doing. The default (1000) should work just fin
e.

import:
  # Set this if you import multiple phpBB forums into a single Discourse forum.
  #
  # For example, when importing multiple sites, prefix all imported IDs
  # with 'first' to avoid conflicts. Subsequent import runs must have a
  # different 'site_name'.
  #
  # site_name: first
  #
  site_name: Freedom Owners Forum

  # Create new categories
  #
  # For example, to create a parent category and a subcategory.
  #
  # new_categories:
  # - forum_id: foo
  # name: Foo Category
  # - forum_id: bar
  # name: Bar Category
  # parent_id: foo
  #
  new_categories: 
 - forum_id: general
   name: General
 - forum_id: systems
   name: Boat Systems
 - forum_id: photos
   name: Photos
 - forum_id: docs
   name: Manuals and Documentation
 - forum_id: buy
   name: Buy/Sell/Trade
 - forum_id: site
   name: Site Usage
 - forum_id: archives
   name: Archives

  # Category mappings
  #
  # * "source_category_id" is the forum ID in phpBB3
  # * "target_category_id" is either a forum ID from phpBB3 or a "forum_id"
  # from the "new_categories" setting (see above)
  # * "discourse_category_id" is a category ID from Discourse
  # * "skip" allows you to ignore a category during import
  #
  # Use "target_category_id" if you want to merge categories and use
  # "discourse_category_id" if you want to import a forum into an existing
  # category in Discourse.
  #
  # category_mappings:
  # - source_category_id: 1
  # target_category_id: foo
  # - source_category_id: 2
  # discourse_category_id: 42
  # - source_category_id: 6
  # skip: true
  #
  category_mappings: 
  - source_category_id: 8
      target_category_id: systems
  - source_category_id: 7
      target_category_id: systems
  - source_category_id: 9
      target_category_id: systems
  - source_category_id: 10
      target_category_id: buy
  - source_category_id: 11
      target_category_id: general
  - source_category_id: 12
      target_category_id: general
  - source_category_id: 13
      target_category_id: general
  - source_category_id: 14
      target_category_id: general
  - source_category_id: 16
      target_category_id: docs
  - source_category_id: 17
      target_category_id: docs
  - source_category_id: 18
      target_category_id: general
  - source_category_id: 19
      target_category_id: general
  - source_category_id: 20
      target_category_id: general
  - source_category_id: 21
      target_category_id: docs
  - source_category_id: 22
      target_category_id: general
  - source_category_id: 23
      target_category_id: site
  - source_category_id: 24
      target_category_id: general
  - source_category_id: 25
      target_category_id: site
  - source_category_id: 42
      target_category_id: systems
  - source_category_id: 43
      target_category_id: docs
  - source_category_id: 44
      target_category_id: general
  - source_category_id: 45
      target_category_id: general
  - source_category_id: 46
      target_category_id: site
  - source_category_id: 48
      target_category_id: general
  - source_category_id: 56
      target_category_id: general
  - source_category_id: 58
      target_category_id: systems
  - source_category_id: 59
      skip: true
  - source_category_id: 60
      target_category_id: archives
  - source_category_id: 61
      target_category_id: archives
  - source_category_id: 62
      target_category_id: archives
  - source_category_id: 63
      target_category_id: archives
  - source_category_id: 64
      target_category_id: general
  - source_category_id: 65
      target_category_id: site

  # Tag mappings
  #
  # For example, imported topics from phpBB category 1 will be tagged
  # with 'first-category', etc.
  #
  # tag_mappings:
  # 1:
  # - first-category
  # 2:
  # - second-category
  # 3:
  # - third-category
  #
  tag_mappings: {}

  # Rank to trust level mapping
  #
  # Map phpBB 3.x rank levels to trust level
  # Users with rank at least 3000 will have TL3, etc.
  #
   rank_mapping:
     trust_level_1: 200
     trust_level_2: 1000
     trust_level_3: 3000
  
# rank_mapping: {}

  # WARNING: Do not activate this option unless you know what you are doing.
  # It will probably break the BBCode to Markdown conversion and slows down your import.
  use_bbcode_to_md: false

  # This is the path to the root directory of your current phpBB installation (or a copy of it).
  # The importer expects to find the /files and /images directories within the base directory.
  # You need to change this to something like /var/www/phpbb if you are not using the Docker based importer.
  # This is only needed if you want to import avatars, attachments or custom smilies.
  phpbb_base_dir: /shared/import/data

  site_prefix:
    # this is needed for rewriting internal links in posts
    original: freedomyachts.org # without http(s)://
    new: https://test.freedomyachts.org # with http:// or https://

  # Enable this, if you want to redirect old forum links to the new locations.
  permalinks:
    categories: true # redirects /viewforum.php?f=1 to /c/category-name
    topics: true # redirects /viewtopic.php?f=6&t=43 to /t/topic-name/81
    posts: false # redirects /viewtopic.php?p=2455#p2455 to /t/topic-name/81/4
    # Append a prefix to each type of link, e.g. 'forum' to redirect /forum/viewtopic.php?f=6&t=43 to /t/topic-na
me/81
    # Leave it empty if your forum wasn't installed in a subfolder.
    prefix:

  avatars:
    uploaded: true # import uploaded avatars
    gallery: true # import the predefined avatars phpBB offers
    remote: false # WARNING: This can considerably slow down your import. It will try to download remote avatar
s.

  # When true: Anonymous users are imported as suspended users. They can't login and have no email address.
  # When false: The system user will be used for all anonymous users.
  anonymous_users: true

  # Enable this, if you want import password hashes in order to use the "migratepassword" plugin.
  # This will allow users to login with their current password.
  # The plugin is available at: https://github.com/discoursehosting/discourse-migratepassword
  passwords: true

  # By default all the following things get imported. You can disable them by setting them to false.
  bookmarks: true
  attachments: true
  private_messages: true
  polls: true

  # Import likes from the phpBB's "Thanks for posts" extension
  likes: false

  # When true: each imported user will have the original username from phpBB as its name
  # When false: the name of each imported user will be blank unless the username was changed during import
  username_as_name: false

  # Map Emojis to smilies used in phpBB. Most of the default smilies already have a mapping, but you can override
  # the mappings here, if you don't like some of them.
  # The mapping syntax is: emoji_name: 'smiley_in_phpbb'
  # Or map multiple smilies to one Emoji: emoji_name: ['smiley1', 'smiley2']
  emojis:
    # here are two example mappings...
    smiley: [':D', ':-D', ':grin:']
    heart: ':love:'

  # Map custom profile fields from phpBB to custom user fields in Discourse (works for phpBB 3.1+)
  #
  # custom_fields:
  # - phpbb_field_name: "company_name"
  # discourse_field_name: "Company"
  # - phpbb_field_name: "facebook"
  # discourse_field_name: "Facebook"
  custom_fields: []

```

---

<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월 5, 2024, 11:46오전 UTC](https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/776 "2024-09-05T11:46:13Z")

</div>

사용자 이름과 비밀번호가 없습니다.

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

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