You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Nova Resource:Discourse/runbooks

From Wikitech-static
< Nova Resource:Discourse
Revision as of 11:08, 28 November 2021 by imported>Gergő Tisza (Created page with "== Updating == # backup the site: #:<syntaxhighlight lang="shell"> cd /var/discourse/ sudo ./launcher enter app discourse backup exit # possibly make local copy of /var/discourse/shared/standalone/backups/default/<filename> # possibly make local copy of /var/discourse/containers/app.yml </syntaxhighlight> # do the upgrade: #:<syntaxhighlight lang="shell"> cd /var/discourse/ git status sudo git tag -f state-before-upgrade sudo git pull # this will take a while, might want...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Updating

  1. backup the site:
    cd /var/discourse/
    sudo ./launcher enter app
    discourse backup
    exit
    # possibly make local copy of /var/discourse/shared/standalone/backups/default/<filename>
    # possibly make local copy of /var/discourse/containers/app.yml
    
  2. do the upgrade:
    cd /var/discourse/
    git status
    sudo git tag -f state-before-upgrade
    sudo git pull
    # this will take a while, might want to use screen
    # if there isn't enough space, stop the app first with
    #   sudo ./launcher stop app
    sudo ./launcher rebuild app
    

If you are out of space, you can stop the app and delete containers first (will render the site inoperable until a successful rebuild):

sudo ./launcher stop app --skip-prereqs
sudo ./launcher cleanup
sudo ./launcher rebuild app

Freeing up disk space

  1. delete old docker containers:
    cd /var/discourse/
    sudo ./launcher cleanup
    
  2. delete some of the older backups from /var/discourse/shared/standalone/backups/default/
  3. delete apt cache: sudo apt-get clean

Enabling/disabling readonly mode from command line

cd /var/discourse/
sudo ./launcher enter app
rails c
Discourse.enable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)
# or Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)