How to upgrade Discourse from 1.6.1 version to latest_release

On Discourse version 1.6.1 we have customised as per our requirement and added multiple models both on rails and javascript side and some customisations in Javascript libraries as well.

Now we are trying to integrate Babble chat plugin for which we are facing many issues like manually placing the missing JS files and updating relative path of libraries imported. So we are planning to upgrade the discourse version to latest with which we can easily integrate babble chat plugin. Below mentioned points are my concern.

- Easy way to integrate babble chat plugin with discourse 1.6.1.
- Upgrade discourse with out effecting the existing functionality(created by us).

Given that your customizations are plugins, I’d set up a test site, copy your data over, and run the upgrade and see what happens.

Our customisations are not plugins, we modified many js files and created new models.
Is there any command to run the upgrade for discourse?

Sure. Just do a git pull and merge.

I really hope you modified Discourse in some way other than modifying the Docker container directly. Assuming you have these modifications stored in source control, pull and merge is your best route. If you didn’t you’re going to be in a rough time trying to find your modifications, transfer them, and test them.

No, there is no command, you performed your customization in an unsupportable way. You are going to need a very skilled developer with lots of time to get you upgraded to latest, something I strongly recommend doing cause there are may public security vulnerabilities that have since been patched.

Lest it was unclear,

left out the very likely possibility that “and merge” will involve some weeks of programming.

Perhaps you can move your changes into plugins and revert to un-modified 1.6.1 code.

Wanted to chime in here with a personal anecdote: A few months ago I took over managing a Discourse forum where I work. The forum is used seasonally, for about 5 months, then not touched for 7. When I took over we were having all sorts of intermittent issues. After the forum went “partially down” 3 times in 4 days, it was decided that I’d work with our IT staff to figure out what was wrong. Almost 6 hours later, we found that a former dev modified Discourse files, set them to overwrite the existing Discoures files each update, and this was the cause of our issues. 4 days of nearly full-time work later, we’d managed to stop the files from being overwritten, develop a plugin, and get everything working again.


Why am I sharing this? I just want to emphasize that modifying Discourse is unsupported (read: not a plugin) ways is bad. While we only had a few files modified, it caused us major issues that fortunately were caught before our forums went live again for the season. Please take the time to un-modify your install, put the changes into a plugin, and only then attempt an update.

So is it safe to assume we can upgrade multiple versions at once? In other words, can we go straight from say v2.1 to v2.3?

Yes, it is generally safe to upgrade multiple major releases at once. Rails migrations handle that for you.

However, it is always a good idea to take a full backup before major changes like this, so you have the ability to restore to a known working state in the unlikely event something goes very wrong.

你好,Joshua,

我现在处于一个令人兴奋的阶段,需要从 v2.1.0.beta2 +119 升级到 2.4.0.beta4。

当然,我对此略感紧张,因此想请教一下,我该如何进行完整备份?

我们是在 Docker 容器中运行此服务的。此外,我们每天也会通过管理面板进行备份。但如果我尝试使用 ./launcher rebuild app 进行升级时出现问题,该如何回退到之前的(正常工作的)版本?据我所见,备份仅包含 Postgres 数据库的 SQL 文件。所有图片都存储在 S3 中的其他位置。

如果您能提供任何指导,我将不胜感激。

谢谢,
Steve

你好,Stephen,

是的,这应该可以顺利运行。重建失败的可能性极低,即使失败也不会造成任何损坏。你的网站会暂时停机,但数据存储在持久化存储位置(不在 Docker 容器中),因此是安全的。

进行备份是个好主意(务必定期备份),是的,你的上传文件不会被包含在备份中下载。你的数据库引用的是 S3 上的上传文件,在备份和恢复后依然会如此。因此,无需下载这些文件,它们已经安全地存储在 S3 中了。

如果重建过程中出现任何问题,请将日志输出贴到这里!