היי, אני מפרסם כאן אחרי שניסיתי הכל ונתקעתי עם השדרוג שלי.
עדכנתי את הפורום אחרי חודשים רבים. הרצתי גיבוי כרגיל והורדתי אותו.
ככל הנראה, בתהליך העדכון הזה, ישנה העברה מ-PG 13 ל-15.
הכל פעל ללא בעיות עד שהעדכון נכשל והופרעתי עקב חוסר במקום בדיסק.
הלכתי ל-Digitalocean droplet שלי, עצרתי אותו, הרחבתי את הדיסק, והפעלתי אותו שוב
הרצתי כמה פקודות רגילות כדי לשחרר מקום בדיסק (הסרת יומנים ישנים, ./launcher cleanup, וכו’)
אז התחלתי את הבנייה מחדש, ואז פגעתי בקיר הראשון:
root@discourse-ubuntu-s-2vcpu-4gb-fra1-01:/var/discourse# ./launcher rebuild app
אזהרה: גרסת Docker 20.10.1 הוצאה משימוש, מומלץ לשדרג לגרסה 24.0.7 או חדשה יותר.
זוהתה ארכיטקטורת x86_64.
אזהרה: הקובץ containers/app.yml ניתן לקריאה על ידי כולם
If you made a backup like you said you did, the easiest thing is to spin up a new droplet, follow Move a Discourse site to another VPS with rsync (but do not copy the database files), and then restore your backup.
Hi Jay! thank you so much for responding. Just started doing that, the droplet is setting up right now.
Quick question: I downloaded my backup file before starting the update, this is the file: forumname-2025-06-11-060249-v20240807024301.tar.gz (4,6GB compressed)Forum version was v3.3.0.beta6 +294 with PG13.
I was planning to initialize the new droplet forcing this version in the app.yml, like:
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
- "80:80" # http
- "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
db_shared_buffers: "1024MB"
## can improve sorting performance, but adds memory usage per-connection
#db_work_mem: "40MB"
## Which Git revision should this container use? (default: tests-passed)
version: v3.3.0.beta6
And then, with the new forum up and running, import the backup from there.
Does this makes sense? or I am missing some important param or step?
Thanks again, Jay, for responding. I really appreciate your time helping me through this nightmare.
I’m trying to do it that way (forcing the version in the YML) but apparently discourse_docker is not happy (yet) with that change:
FAILED
--------------------
Pups::ExecError: grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The "before-server" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 ) failed with return #<Process::Status: pid 2788 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in spawn'
exec failed with the params {"cmd"=>["cp $home/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf", "rm /etc/nginx/sites-enabled/default", "mkdir -p /var/nginx/cache", "grep -q 'outlets/before-server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"before-server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/server' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"server\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "grep -q 'outlets/discourse' /etc/nginx/conf.d/discourse.conf || ( >&2 echo 'The \"discourse\" Nginx outlet is missing. This version of discourse_docker is not compatible with the chosen Discourse version.' ; exit 1 )", "mkdir -p /etc/nginx/conf.d/outlets/before-server", "touch /etc/nginx/conf.d/outlets/before-server/20-redirect-http-to-https.conf", "touch /etc/nginx/conf.d/outlets/before-server/30-ratelimited.conf", "mkdir -p /etc/nginx/conf.d/outlets/server", "touch /etc/nginx/conf.d/outlets/server/10-http.conf", "touch /etc/nginx/conf.d/outlets/server/20-https.conf", "touch /etc/nginx/conf.d/outlets/server/30-offline-page.conf", "mkdir -p /etc/nginx/conf.d/outlets/discourse", "touch /etc/nginx/conf.d/outlets/discourse/20-https.conf", "touch /etc/nginx/conf.d/outlets/discourse/30-ratelimited.conf"]}
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.
d511b0ec31ac912c99c682611c35bbb446dde1488e1762aa07ccd24690c63164
2/2
Before updating I took an screenshot to the current version just in case, is there any way to force discourse_docker to a compatible older version?
I’m trying searching on google and here in meta, but nothing yet about how to do it.
However, quick question: If the backup is from an old version of Discourse that were using PG13, will I have problems importing the backup into the latest version of Discourse with PG15?
מצטער @pfaffman כתבתי הודעה קודמת כשחשבתי שהבעיה נפתרה אבל אז התרחש טוויסט בעלילה.
אחרי זמן רב של ייבוא, ראיתי איך הפורום שוב מקוון ומציג את כל הפוסטים וכו’.
בטרמינל, הלוג היה:
[...]
-- execute("DELETE FROM site_settings WHERE name='warn_reviving_old_topic_age'")
-\"> 0.0002s
== 20250609115711 RemoveComposerTipsSiteSettings: migrated (0.0012s) ==========
מתחבר מחדש למסד הנתונים...
טוען מחדש את הגדרות האתר...
משבית שליחת מיילים למשתמשים שאינם צוות...
משבית מצב קריאה בלבד...
מנקה את מטמון הקטגוריות...
טוען מחדש תרגומים...
ממפה מחדש העלאות...
משחזר העלאות, זה עשוי לקחת זמן מה...
מעביר העלאות ל-S3 עבור 'default'...
מעלה קבצים ל-S3...
- מפרט קבצים מקומיים
=> 5 files
- מפרט קבצי S3
............................................................................................................................................................................ => 171490 files
- מסנכרן קבצים ל-S3
.....
מעדכן את כתובות ה-URL במסד הנתונים...
הייתי שם זמן מה, וחשבתי שזו רק חיבור הטרמינל שלי. עם זאת, כמה דקות לאחר מכן, הוא המשיך להסתיים בכישלון:
490 files
- מסנכרן קבצים ל-S3
.....
מעדכן את כתובות ה-URL במסד הנתונים...
מסיר תמונות מותאמות ישנות...
מסמן את כל הפוסטים המכילים תיבות אור לאפייה מחדש...
76198 פוסטים סומנו לאפייה מחדש
חריגה: 903 פוסטים לא ממופים מחדש לכתובת URL חדשה של העלאה ל-S3. העברת S3 נכשלה עבור db 'default'.
/var/www/discourse/lib/file_store/to_s3_migration.rb:132:in `raise_or_log'
/var/www/discourse/lib/file_store/to_s3_migration.rb:81:in `migration_successful?'
/var/www/discourse/lib/file_store/to_s3_migration.rb:383:in `migrate_to_s3'
/var/www/discourse/lib/file_store/to_s3_migration.rb:59:in `migrate'
/var/www/discourse/lib/file_store/s3_store.rb:354:in `copy_from'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:69:in `restore_uploads'
/var/www/discourse/lib/backup_restore/uploads_restorer.rb:49:in `restore'
/var/www/discourse/lib/backup_restore/restorer.rb:167:in `restore_uploads'
/var/www/discourse/lib/backup_restore/restorer.rb:71:in `run'
script/discourse:191:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
script/discourse:345:in `
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:59:in `load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:59:in `kernel_load'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:452:in `exec'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/cli.rb:29:in `start'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/exe/bundle:28:in `block in
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.6.4/exe/bundle:20:in `
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `
מנסה לבצע גלגול לאחור...
מבצע גלגול לאחור...
מנקה דברים...
מוחק פונקציות מסכימת discourse_functions...
מסיר ספריית tmp '/var/www/discourse/tmp/restores/default/2025-06-11-121115'...
מבטל השהיית sidekiq...
מסמן שחזור כסיום...
מודיע ל'system' על סיום השחזור...
סיום!
[נִכשָׁל]
השחזור הסתיים.
```פתאום, הפורום ש"שוחזר" באינטרנט, כל הפוסטים נעלמו, והשאירו רק כמה נושאים בחיים.
מכיוון שהיומן אומר ש"76198 פוסטים סומנו לאפייה מחדש (rebake)", חשבתי שזה רק אומר שעכשיו צריך לאפות אותם מחדש, אז הלכתי לסיידקיק (Sidekiq) אבל אין שם שום דבר שממתין לעיבוד :(


Sigh. Are you using the same hostname? (Maybe so?)
That’s your problem now.
Did you configure S3 in the database or in the yml file? I guess it’s the former. The easiest thing would be to restore a database-only, but that’s hard to explain (extract the sql file and then name it with the same stuff as the tar.gz file)
You can try this
discourse restore --pause <backup_filename>
That will pause before it tries to restore the S3 stuff. Then, if you knew what to do, you could fix the issue with the errant uploads.
Another thing would be to set DISCOURSE_USE_S3 to false in your app.yml. You might need to set the other S3 stuff too like the ones that say to use S3 uploads and/or the S3 buckets.
I set S3 back in the day for a while, but then remove it, so those posts with S3 images are quite old.
Is there a way to identify them and ignore/remove them, so the import can work with no friction?
Another thing would be to set DISCOURSE_USE_S3 to false in your app.yml . You might need to set the other S3 stuff too like the ones that say to use S3 uploads and/or the S3 buckets.
I will try this too, because at the end, we don’t care about those S3 files or posts, it is just I don’t know yet how to handle it to ignore them
You should have told me from the beginning! I would have gladly paid in the first place! hehe
It is up and running now.
After trying tons of things, I ended up doing some counterintuitive but that it is working now:
Setup S3 in the new instance properly (via admin panel)
Ran the import with the –pause thing but in the second step, just stopped the process. I was expecting the forum to no work or having issues with the images, but it is running and old images are loading with no issue.
I still testing things, maybe I find something broken later, but by now, after 12h of troubleshooting, I’ll call it a win for now.