Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Fediverse
  3. Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social!

Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social!

Scheduled Pinned Locked Moved Fediverse
sharkeyupgradesharkeyadmin
2 Posts 1 Posters 4 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • gme@bofh.socialG This user is from outside of this forum
    gme@bofh.socialG This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1

    Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social! #SharkeyAdmin

    #!/bin/bash
    
    set -e  # Exit immediately if a command exits with a non-zero status
    set -u  # Treat unset variables as an error
    
    echo "Stopping Sharkey and Redis services..."
    systemctl stop sharkey
    systemctl stop redis
    
    # Optional: Update NodeJS (uncomment if needed)
    # --------------------------------------------
    # echo "Updating NodeJS..."
    # apt remove -y nodejs
    # curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
    # apt install -y nodejs
    # apt install -y libpango1.0-dev libcairo2-dev libpixman-1-dev
    
    echo "Updating Sharkey codebase..."
    sudo -u sharkey bash <<'EOF'
    cd ~/Sharkey
    git checkout stable
    git stash
    git pull --recurse-submodules
    pnpm clean-all
    # corepack enable && corepack prepare [email protected] --activate  # Optional if using corepack
    pnpm install --frozen-lockfile
    pnpm run build
    pnpm run migrate
    EOF
    
    echo "Restarting services..."
    systemctl start redis
    systemctl start sharkey
    
    echo "✅ Sharkey update complete."

    gme@bofh.socialG 1 Reply Last reply
    0
    • gme@bofh.socialG [email protected]

      Our #Sharkey one-stop #upgrade script worked beautifully, and just finished using it to upgrade Sharkey here on bofh.social! #SharkeyAdmin

      #!/bin/bash
      
      set -e  # Exit immediately if a command exits with a non-zero status
      set -u  # Treat unset variables as an error
      
      echo "Stopping Sharkey and Redis services..."
      systemctl stop sharkey
      systemctl stop redis
      
      # Optional: Update NodeJS (uncomment if needed)
      # --------------------------------------------
      # echo "Updating NodeJS..."
      # apt remove -y nodejs
      # curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
      # apt install -y nodejs
      # apt install -y libpango1.0-dev libcairo2-dev libpixman-1-dev
      
      echo "Updating Sharkey codebase..."
      sudo -u sharkey bash <<'EOF'
      cd ~/Sharkey
      git checkout stable
      git stash
      git pull --recurse-submodules
      pnpm clean-all
      # corepack enable && corepack prepare [email protected] --activate  # Optional if using corepack
      pnpm install --frozen-lockfile
      pnpm run build
      pnpm run migrate
      EOF
      
      echo "Restarting services..."
      systemctl start redis
      systemctl start sharkey
      
      echo "✅ Sharkey update complete."

      gme@bofh.socialG This user is from outside of this forum
      gme@bofh.socialG This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      Heads up #Sharkey #admins when #upgrading...
      If you have a lot of
      #data in your #instance #database, running pnpm run migrate might fail because one or more of the ALTER TABLE... statements might actually timeout on your #PostgreSQL server!

      To fix this, attach yourself to your
      sharkey database and enter the following...

      ALTER DATABASE sharkey SET statement_timeout = '10min'; 
      ALTER ROLE sharkey SET statement_timeout = '10min';
      ...and try the pnpm run migrate command again.

      #SharkeyAdmin #InstanceAdmin @[email protected]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups