<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.opensourceecology.org/index.php?action=history&amp;feed=atom&amp;title=Discourse%2FUpdating</id>
	<title>Discourse/Updating - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.opensourceecology.org/index.php?action=history&amp;feed=atom&amp;title=Discourse%2FUpdating"/>
	<link rel="alternate" type="text/html" href="https://wiki.opensourceecology.org/index.php?title=Discourse/Updating&amp;action=history"/>
	<updated>2026-04-13T06:43:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.13</generator>
	<entry>
		<id>https://wiki.opensourceecology.org/index.php?title=Discourse/Updating&amp;diff=221813&amp;oldid=prev</id>
		<title>Maltfield at 17:11, 21 May 2020</title>
		<link rel="alternate" type="text/html" href="https://wiki.opensourceecology.org/index.php?title=Discourse/Updating&amp;diff=221813&amp;oldid=prev"/>
		<updated>2020-05-21T17:11:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:11, 21 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This guide describes how to update Discourse installed on our production [[OSE_Server]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;For a guide on how to install Discourse on CentOS 7, see [[Discourse/Install]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To see our general Discourse page, see [[Discourse]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Updating Discoruse=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Updating Discoruse=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l243&quot;&gt;Line 243:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 249:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our backup cron also takes a tar of most of the &amp;#039;&amp;lt;code&amp;gt;/var/discourse&amp;lt;/code&amp;gt;&amp;#039; directory, but this process doesn&amp;#039;t stop the Discourse application, so it&amp;#039;s an option for restore as a last-resort and not covered here.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Our backup cron also takes a tar of most of the &amp;#039;&amp;lt;code&amp;gt;/var/discourse&amp;lt;/code&amp;gt;&amp;#039; directory, but this process doesn&amp;#039;t stop the Discourse application, so it&amp;#039;s an option for restore as a last-resort and not covered here.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=References=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Reflist}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=Links=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# [[Discourse]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# [[Discourse/Install]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: IT Infrastructure]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Software]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maltfield</name></author>
	</entry>
	<entry>
		<id>https://wiki.opensourceecology.org/index.php?title=Discourse/Updating&amp;diff=221751&amp;oldid=prev</id>
		<title>Maltfield: Created page with &quot;=Updating Discoruse=  This section will describe how to update the Discourse software  ==Discourse Versions==  First, a note about Discourse releases: Discourse maintains a &quot;s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.opensourceecology.org/index.php?title=Discourse/Updating&amp;diff=221751&amp;oldid=prev"/>
		<updated>2020-05-21T16:25:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Updating Discoruse=  This section will describe how to update the Discourse software  ==Discourse Versions==  First, a note about Discourse releases: Discourse maintains a &amp;quot;s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Updating Discoruse=&lt;br /&gt;
&lt;br /&gt;
This section will describe how to update the Discourse software&lt;br /&gt;
&lt;br /&gt;
==Discourse Versions==&lt;br /&gt;
&lt;br /&gt;
First, a note about Discourse releases: Discourse maintains a &amp;quot;stable&amp;quot; release, but they don&amp;#039;t actually backport bug patches to their stable releases like one would expect. There&amp;#039;s no LTS (or STS!) for Discourse stable releases.&lt;br /&gt;
&lt;br /&gt;
They only fix bugs in future beta releases (which will also include new commits that may break more things). Therefore, the default branch for production is &amp;quot;beta&amp;quot; releases, and they urge their customers not to use &amp;quot;stable.&amp;quot; I honestly think this is a terrible idea, especially for a small org like OSE without any full-time ops staff to constantly update our prod apps.&lt;br /&gt;
&lt;br /&gt;
 * https://github.com/discourse/discourse/releases&lt;br /&gt;
&lt;br /&gt;
IMHO, the takeaway to this is that updates should be done to Discourse very carefully and with through testing in staging before taking a backup and following the identical procedure on production.&lt;br /&gt;
&lt;br /&gt;
==Check for Updates==&lt;br /&gt;
&lt;br /&gt;
Discourse updates often, and it will tell you to update the app (requiring downtime) even if there&amp;#039;s 1 (untested?) commit to their discourse github repository&lt;br /&gt;
&lt;br /&gt;
First, determine your current version by logging-in and visiting the Admin section. You&amp;#039;ll see the version listed as a version number (ex: 2.5.0.beta3) and a git commit hash (ex: 8e28ccb2ea). Be sure to write down the current version in your notes in-case something goes wrong during the upgrade.&lt;br /&gt;
&lt;br /&gt;
 * https://discourse.opensourceecology.org/admin&lt;br /&gt;
&lt;br /&gt;
And you can determine the latest version by checking the Discourse projects&amp;#039; github releases section &lt;br /&gt;
&lt;br /&gt;
 * https://github.com/discourse/discourse/releases&lt;br /&gt;
&lt;br /&gt;
==Step 0: Trigger Backup Scripts for System-Wide backup==&lt;br /&gt;
&lt;br /&gt;
For good measure, trigger a backup of the entire system&amp;#039;s database &amp;amp; files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su -&lt;br /&gt;
time sudo /bin/nice /root/backups/backup.sh &amp;amp;&amp;gt;&amp;gt; /var/log/backups/backup.log&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When finished, list the backup files in our [[Backblaze]] B2 server backups bucket to verify that the whole system backup was successful before proceeding&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source /root/backups/backup.settings&lt;br /&gt;
$SUDO -u ${b2UserName} $B2 ls ${B2_BUCKET_NAME}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Step 1: Set variables==&lt;br /&gt;
&lt;br /&gt;
Type these commands to set some variables, which will be used by the commands in the sections below. Replace &amp;#039;www.opensourceecology.org&amp;#039; with the corresponding directory for the wp site you&amp;#039;re updating.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo su -&lt;br /&gt;
export vhostDir=&amp;quot;/var/discourse/&amp;quot;&lt;br /&gt;
export stamp=`date +%Y%m%d_%T`&lt;br /&gt;
export tmpDir=&amp;quot;/var/tmp/discourseUpgrade.${stamp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# verify&lt;br /&gt;
echo &amp;quot;${vhostDir}&amp;quot;&lt;br /&gt;
echo &amp;quot;${stamp}&amp;quot;&lt;br /&gt;
echo &amp;quot;${tmpDir}&amp;quot;&lt;br /&gt;
ls -lah &amp;quot;${vhostDir}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Step 2: Make Vhost-specific backups==&lt;br /&gt;
&lt;br /&gt;
The backups made in the previous step are huge. Because it&amp;#039;s easier to work with vhost-specific backups, let&amp;#039;s make a redundant copy available in /var/tmp/:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir &amp;quot;${tmpDir}&amp;quot;&lt;br /&gt;
chown root:root &amp;quot;${tmpDir}&amp;quot;&lt;br /&gt;
chmod 0700 &amp;quot;${tmpDir}&amp;quot;&lt;br /&gt;
pushd &amp;quot;${tmpDir}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# discourse backup (db &amp;amp; uploaded files only)&lt;br /&gt;
nice rm -rf /var/discourse/shared/standalone/backups/default/*.tar.gz&lt;br /&gt;
time nice docker exec discourse_ose discourse backup&lt;br /&gt;
nice mv /var/discourse/shared/standalone/backups/default/*.tar.gz ${tmpDir}/&lt;br /&gt;
&lt;br /&gt;
# files backup (all discourse files)&lt;br /&gt;
time nice tar --exclude &amp;quot;${vhostDir}/shared/standalone/postgres_data&amp;quot; --exclude &amp;quot;${vhostDir}/shared/standalone/postgres_data/uploads&amp;quot; --exclude &amp;quot;${vhostDir}/shared/standalone/backups&amp;quot; -czf ${tmpDir}/discourse_files.${stamp}.tar.gz /var/discourse/*&lt;br /&gt;
&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Step 3: Update git==&lt;br /&gt;
&lt;br /&gt;
First, try a `&amp;lt;code&amp;gt;git pull origin master&amp;lt;/code&amp;gt;` from the &amp;#039;&amp;lt;code&amp;gt;/var/discourse&amp;lt;/code&amp;gt;&amp;#039; directory. If it says that you&amp;#039;re &amp;quot;Already up-to-date.&amp;quot;, then skip this section. If you have [[#.60git_pull.60_fail|merge errors]], then you&amp;#039;ll need to proceed with this section.&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve made some OSE-specific changes to the files in &amp;lt;code&amp;gt;/var/discourse&amp;lt;/code&amp;gt; that conflict with the upstream git repo, so let&amp;#039;s move those out of the way before updating. After the &amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;, we&amp;#039;ll update them again.&lt;br /&gt;
&lt;br /&gt;
First execute the commands shown in the example below as root to get a list of all the files that have been modified locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@osestaging1 /]# pushd /var/discourse&lt;br /&gt;
/var/discourse /&lt;br /&gt;
[root@osestaging1 discourse]# git status --short | grep -E &amp;#039;^\s*M&amp;#039;&lt;br /&gt;
 M image/base/install-nginx&lt;br /&gt;
 M launcher&lt;br /&gt;
[root@osestaging1 discourse]# popd&lt;br /&gt;
/&lt;br /&gt;
[root@osestaging1 /]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we see that the &amp;#039;&amp;lt;code&amp;gt;/var/discourse/launcher&amp;lt;/code&amp;gt;&amp;#039; script and &amp;#039;&amp;lt;code&amp;gt;/var/discourse/image/base/install-nginx&amp;lt;/code&amp;gt;&amp;#039; script have both been modified in our custom OSE install. Now let&amp;#039;s move those two files out of the way so we can do a clean `&amp;lt;code&amp;gt;git pull&amp;lt;/code&amp;gt;` after.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands as root. If there were more than just the two files listed above that were modified, then you should update this documentation to reflect the necessary changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export vhostDir=&amp;quot;/var/discourse/&amp;quot;&lt;br /&gt;
stamp=`date &amp;quot;+%Y%m%d_%H%M%S&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
# launcher&lt;br /&gt;
mv &amp;quot;${vhostDir}/launcher&amp;quot; &amp;quot;${vhostDir}/launcher.${stamp}&amp;quot;&lt;br /&gt;
git checkout &amp;quot;${vhostDir}/launcher&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# install-nginx&lt;br /&gt;
mv &amp;quot;${vhostDir}/image/base/install-nginx&amp;quot; &amp;quot;${vhostDir}/image/base/install-nginx.${stamp}&amp;quot;&lt;br /&gt;
git checkout &amp;quot;${vhostDir}/image/base/install-nginx&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now sync to the upstream repo&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd &amp;quot;${vhostDir}&amp;quot;&lt;br /&gt;
git pull origin master&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, let&amp;#039;s get a diff of the changes so we can understand what may have changed upstream, which might break our commands in our OSE Discourse install guide&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff &amp;quot;${vhostDir}/image/base/install-nginx.${stamp}&amp;quot; &amp;quot;${vhostDir}/image/base/install-nginx&amp;quot;&lt;br /&gt;
diff &amp;quot;${vhostDir}/launcher.${stamp}&amp;quot; &amp;quot;${vhostDir}/launcher&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Write down the output from the above commands in your log; you may need it to debug later.&lt;br /&gt;
&lt;br /&gt;
Next, to re-apply the changes to the &amp;#039;&amp;lt;code&amp;gt;install-nginx&amp;lt;/code&amp;gt;&amp;#039; script and &amp;quot;&amp;lt;code&amp;gt;launcher&amp;lt;/code&amp;gt;&amp;#039; script, see the following relevant section for a list of the necessary commands:&lt;br /&gt;
&lt;br /&gt;
# [[#Nginx_mod_security]]&lt;br /&gt;
&lt;br /&gt;
See also https://meta.discourse.org/t/how-do-i-manually-update-discourse-and-docker-image-to-latest/23325&lt;br /&gt;
&lt;br /&gt;
==Step 4: Build Discourse docker image with OSE modifications==&lt;br /&gt;
&lt;br /&gt;
Now we must rebuild the upstream Discourse Docker image with our OSE-specific modifications, such as giving nginx mod_security support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd &amp;quot;${vhostDir}/image/base&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# force a fresh build (no-cache) so the `git pull` lines will trigger&lt;br /&gt;
# note this will take a *ridiculously* long time; the Discourse team compiles many packages from source :(&lt;br /&gt;
time nice docker build --no-cache --network=host --tag &amp;#039;discourse_ose&amp;#039; /var/discourse/image/base/&lt;br /&gt;
&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Step 5: Rebuild the app==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
time nice ${vhostDir}/launcher rebuild discourse_ose&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may also need to restart the &amp;quot;outer&amp;quot; nginx on the docker host too&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl restart nginx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a Backup=&lt;br /&gt;
&lt;br /&gt;
To create a a backup of Discourse, see the &amp;quot;Updating Discourse&amp;quot; Steps 0-2 starting with [[#Step 0: Trigger Backup Scripts for System-Wide backup]]&lt;br /&gt;
&lt;br /&gt;
=Restoring from Backup=&lt;br /&gt;
&lt;br /&gt;
This section will describe how to restore Discourse from a previous backup.&lt;br /&gt;
&lt;br /&gt;
==Discourse backup file==&lt;br /&gt;
&lt;br /&gt;
The best way to restore Discourse from backup is to use the &amp;quot;proper&amp;quot; backup file that was safely generated by the Discourse app itself. After [[OSE_Server#Backups|retreiving the backup file]], copy it to the &amp;#039;&amp;lt;code&amp;gt;/var/discourse/shared/standalone/backups/default&amp;lt;/code&amp;gt;&amp;#039; directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@osestaging1 discourse_ose]# [ -f /var/discourse/shared/standalone/backups/default/ ] || mkdir /var/discourse/shared/standalone/backups/default/&lt;br /&gt;
[root@osestaging1 discourse_ose]# cp discourse-2020-03-08-172140-v20191219112000.tar.gz /var/discourse/shared/standalone/backups/default/&lt;br /&gt;
[root@osestaging1 discourse_ose]# ls -lah /var/discourse/shared/standalone/backups/default/&lt;br /&gt;
total 56M&lt;br /&gt;
drwxr-xr-x. 2 root      root 4.0K Mar 16 16:52 .&lt;br /&gt;
drwxr-xr-x. 3 tgriffing   33 4.0K Mar 16 16:52 ..&lt;br /&gt;
-rw-r--r--. 1 root      root  56M Mar 16 16:52 discourse-2020-03-08-172140-v20191219112000.tar.gz&lt;br /&gt;
[root@osestaging1 discourse_ose]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then execute the following commands as root to initiate the restore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@osestaging1 discourse]# /var/discourse/launcher enter discourse_ose&lt;br /&gt;
root@osestaging1-discourse-ose:/var/www/discourse# discourse enable_restore&lt;br /&gt;
Restore are now permitted. Disable them with `disable_restore`&lt;br /&gt;
root@osestaging1-discourse-ose:/var/www/discourse# discourse restore discourse-2020-03-08-172140-v20191219112000.tar.gz&lt;br /&gt;
Starting restore: discourse-2020-03-08-172140-v20191219112000.tar.gz&lt;br /&gt;
[STARTED]&lt;br /&gt;
&amp;#039;system&amp;#039; has started the restore!&lt;br /&gt;
Marking restore as running...&lt;br /&gt;
Making sure /var/www/discourse/tmp/restores/default/2020-03-16-165545 exists...&lt;br /&gt;
Copying archive to tmp directory...&lt;br /&gt;
Unzipping archive, this may take a while...&lt;br /&gt;
Extracting dump file...&lt;br /&gt;
Validating metadata...&lt;br /&gt;
  Current version: 20200311135425&lt;br /&gt;
  Restored version: 20191219112000&lt;br /&gt;
Enabling readonly mode...&lt;br /&gt;
Pausing sidekiq...&lt;br /&gt;
Waiting up to 60 seconds for Sidekiq to finish running jobs...&lt;br /&gt;
Creating missing functions in the discourse_functions schema...&lt;br /&gt;
Restoring dump file... (this may take a while)&lt;br /&gt;
...&lt;br /&gt;
Cleaning stuff up...&lt;br /&gt;
Dropping functions from the discourse_functions schema...&lt;br /&gt;
Removing tmp &amp;#039;/var/www/discourse/tmp/restores/default/2020-03-16-165545&amp;#039; directory...&lt;br /&gt;
Unpausing sidekiq...&lt;br /&gt;
Marking restore as finished...&lt;br /&gt;
Notifying &amp;#039;system&amp;#039; of the end of the restore...&lt;br /&gt;
Finished!&lt;br /&gt;
[SUCCESS]&lt;br /&gt;
Restore done.&lt;br /&gt;
root@osestaging1-discourse-ose:/var/www/discourse# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it! The Discourse site should now be fully restored. After verification, be sure to disable the restore function again&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@osestaging1-discourse-ose:/var/www/discourse# discourse disable_restore&lt;br /&gt;
Restore are now forbidden. Enable them with `enable_restore`&lt;br /&gt;
root@osestaging1-discourse-ose:/var/www/discourse# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: You may need to restart the docker container to complete the restore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/var/discourse/launcher stop discourse_ose&lt;br /&gt;
/var/discourse/launcher start discourse_ose&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==File backup file==&lt;br /&gt;
&lt;br /&gt;
Our backup cron also takes a tar of most of the &amp;#039;&amp;lt;code&amp;gt;/var/discourse&amp;lt;/code&amp;gt;&amp;#039; directory, but this process doesn&amp;#039;t stop the Discourse application, so it&amp;#039;s an option for restore as a last-resort and not covered here.&lt;/div&gt;</summary>
		<author><name>Maltfield</name></author>
	</entry>
</feed>