Upgrading from 1.6.0 to 3

AI-generated summary

bobpies is upgrading a Discourse instance from 1.6.0 to 3.1 and encounters UI and backend issues after restoring a backup on a dev server. pfaffman advises using a production setup and disabling custom themes before backup — though bobpies later finds themes don’t need disabling if restoring to a fresh DigitalOcean droplet. After migration, editing or creating categories triggers 500 errors. Falco suggests changing slug generation settings, but bobpies reports no improvement. Investigation reveals the error stems from a missing method default_slow_mode_seconds on a Category object bobpies, likely due to a missing database migration. Falco recommends rebuilding the app, which bobpies confirms resolves the issue. The root cause appears to be incomplete schema updates during the upgrade, fixed by running ./launcher rebuild app.

Hi all,

so i’m trying to upgrade my out of date discourse installation from 1.6.0 to the latest.

I’ve created a dev server local, ensured it was running, then restored the 1.6.0 backup onto it.

After the restore is complete my site is all a bit screwy,
All the headers in the admin area start with “en.admin.”

The console is full of errors as well.

Can’t seem to fix it and i’m not quite sure whats wrong.



I would restore to a production setup. Development is rather tricky to get set up correctly, and you’re not going to run your site on development.

Do you have any custom themes? It’s a good bet that they are broken.

ill try a new digital ocean droplet and see if that makes any difference

yes theres custom headers etc. in there.
perhaps i should disable all those before backup?

Disabling them before backup is a good idea.

So i was able to restore succesfully to a new digitalocean droplet - didn’t need to ditch the custom themes in the end.

I’ve got most everything running, except for a bug i’m seeing when i try to edit an existing category

I get a Server Error while trying to load /c/xxxx-xxxx-xxxx/find_by_slug.json
Error code 500 error

I also cannot create new categories - 500 error
and i cannot re-order categories..

Try setting slug generation method to encoded in site settings.

no, tried setting to none as well
still get 500 errors.

I get them when editing existing topics too - slightly differently however, in that the top does get edited, but i still get a 500 error message

on 1.6.0 the request sent to edit a category is

show.json?1674060788449
http://discourse.url.com/c/20/show.json?_=1674060788449

on 3.1 it is using find_by_slug.json
https://discourse.url.com/c/category_name/find_by_slug.json

Go to /logs and share the message and backtrace of those errors here.

Error message

NoMethodError (undefined method `default_slow_mode_seconds' for #<Category id: 20, name: "Music Tech Discussion", color: "ee6b65", topic_id: 36276, topic_count: 5648, created_at: "2016-02-26 12:31:28.

INFO

Message (25 copies reported)

NoMethodError (undefined method `default_slow_mode_seconds' for #<Category id: 20, name: "Music Tech Discussion", color: "ee6b65", topic_id: 36276, topic_count: 5648, created_at: "2016-02-26 12:31:28.763958000 +0000", updated_at: "2023-01-18 15:06:21.512625000 +0000", user_id: 12, topics_year: 7, topics_month: 0, topics_week: 0, slug: "music-tech-discussion", description: nil, text_color: "FFFFFF", read_restricted: false, auto_close_hours: nil, post_count: 56980, latest_post_id: 228821, latest_topic_id: 36207, position: 1, parent_category_id: nil, posts_year: 24, posts_month: 0, posts_week: 0, email_in: nil, email_in_allow_strangers: false, topics_day: 0, posts_day: 0, allow_badges: true, name_lower: "music tech discussion", auto_close_based_on_last_post: false, topic_template: "", contains_messages: nil, sort_order: nil, sort_ascending: nil, uploaded_logo_id: nil, uploaded_background_id: nil, topic_featured_link_allowed: true, all_topics_wiki: false, show_subcategory_list: false, num_featured_topics: 1, default_view: nil, subcategory_list_style: "rows_with_featured_topics", default_top_period: "all", mailinglist_mirror: false, minimum_required_tags: 0, navigate_to_first_post_after_read: false, search_priority: 0, allow_global_tags: false, reviewable_by_group_id: nil, read_only_banner: nil, default_list_filter: "all", allow_unlimited_owner_edits_on_first_post: false>
Did you mean?  default_scopes)
(eval):53:in `_fast_attributes'
app/controllers/application_controller.rb:523:in `serialize_data'
app/controllers/application_controller.rb:532:in `render_serialized'
app/controllers/categories_controller.rb:284:in `find_by_slug'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
config/initializers/100-quiet_logge...

Backtrace

activemodel (7.0.4) lib/active_model/attribute_methods.rb:458:in `method_missing'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:99:in `block in attribute'
(eval):53:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:343:in `as_json'
app/controllers/application_controller.rb:523:in `serialize_data'
app/controllers/application_controller.rb:532:in `render_serialized'

Env

HTTP HOSTS: forumstest.xxx.com

Backtrace

activemodel (7.0.4) lib/active_model/attribute_methods.rb:458:in `method_missing'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:99:in `block in attribute'
(eval):53:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:343:in `as_json'
app/controllers/application_controller.rb:523:in `serialize_data'
app/controllers/application_controller.rb:532:in `render_serialized'
app/controllers/categories_controller.rb:284:in `find_by_slug'
actionpack (7.0.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.0.4) lib/abstract_controller/base.rb:215:in `process_action'
actionpack (7.0.4) lib/action_controller/metal/rendering.rb:53:in `process_action'
actionpack (7.0.4) lib/abstract_controller/callbacks.rb:234:in `block in process_action'
activesupport (7.0.4) lib/active_support/callbacks.rb:118:in `block in run_callbacks'
app/controllers/application_controller.rb:414:in `block in with_resolved_locale'
i18n (1.12.0) lib/i18n.rb:322:in `with_locale'
app/controllers/application_controller.rb:414:in `with_resolved_locale'
activesupport (7.0.4) lib/active_support/callbacks.rb:127:in `block in run_callbacks'
activesupport (7.0.4) lib/active_support/callbacks.rb:138:in `run_callbacks'
actionpack (7.0.4) lib/abstract_controller/callbacks.rb:233:in `process_action'
actionpack (7.0.4) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (7.0.4) lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
activesupport (7.0.4) lib/active_support/notifications.rb:206:in `block in instrument'
activesupport (7.0.4) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (7.0.4) lib/active_support/notifications.rb:206:in `instrument'
actionpack (7.0.4) lib/action_controller/metal/instrumentation.rb:66:in `process_action'
actionpack (7.0.4) lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
activerecord (7.0.4) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (7.0.4) lib/abstract_controller/base.rb:151:in `process'
actionview (7.0.4) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (3.0.0) lib/mini_profiler/profiling_methods.rb:111:in `block in profile_method'
actionpack (7.0.4) lib/action_controller/metal.rb:188:in `dispatch'
actionpack (7.0.4) lib/action_controller/metal.rb:251:in `dispatch'
actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.0.4) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (7.0.4) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (7.0.4) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:852:in `call'
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
rack (2.2.6.2) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.6.2) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.6.2) lib/rack/head.rb:12:in `call'
actionpack (7.0.4) lib/action_dispatch/http/permissions_policy.rb:38:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:366:in `call'
rack (2.2.6.2) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.6.2) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/cookies.rb:696:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (7.0.4) lib/active_support/callbacks.rb:99:in `run_callbacks'
actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
logster (2.11.3) lib/logster/middleware/reporter.rb:43:in `call'
railties (7.0.4) lib/rails/rack/logger.rb:40:in `call_app'
railties (7.0.4) lib/rails/rack/logger.rb:27:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/request_id.rb:26:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
rack (2.2.6.2) lib/rack/method_override.rb:24:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.6.2) lib/rack/sendfile.rb:110:in `call'
actionpack (7.0.4) lib/action_dispatch/middleware/host_authorization.rb:131:in `call'
rack-mini-profiler (3.0.0) lib/mini_profiler/profiler.rb:393:in `call'
message_bus (4.3.2) lib/message_bus/rack/middleware.rb:60:in `call'
lib/middleware/request_tracker.rb:228:in `call'
railties (7.0.4) lib/rails/engine.rb:530:in `call'
railties (7.0.4) lib/rails/railtie.rb:226:in `public_send'
railties (7.0.4) lib/rails/railtie.rb:226:in `method_missing'
rack (2.2.6.2) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.6.2) lib/rack/urlmap.rb:58:in `each'
rack (2.2.6.2) lib/rack/urlmap.rb:58:in `call'
unicorn (6.1.0) lib/unicorn/http_server.rb:634:in `process_client'
unicorn (6.1.0) lib/unicorn/http_server.rb:739:in `worker_loop'
unicorn (6.1.0) lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
unicorn (6.1.0) lib/unicorn/http_server.rb:143:in `start'
unicorn (6.1.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/3.1.0/bin/unicorn:25:in `load'
vendor/bundle/ruby/3.1.0/bin/unicorn:25:in `<main>'

Looks like it’s missing a migration? Can you try a rebuild?

./launcher rebuild app?

Rebuilding now, will update you shortly

Looks like that fixed it!

thank you so much