Skip to content

Instantly share code, notes, and snippets.

@pedrom34
Last active March 26, 2024 23:47
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pedrom34/d1b8ab84e1e9ec7e8c6cbcc3cc51d663 to your computer and use it in GitHub Desktop.
Save pedrom34/d1b8ab84e1e9ec7e8c6cbcc3cc51d663 to your computer and use it in GitHub Desktop.
Script to update firefly-iii
#!/bin/bash
#Modify next line to where your firefly-iii instance is installed to.
cd /var/www
#Remove old backup of firefly-iii
rm -r firefly-iii-old
#Backup current version of firefly-iii
cp -r firefly-iii firefly-iii-old
#Get latest version of firefly
latestversion=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest \
| grep "tag_name" \
| awk '{print "https://github.com/firefly-iii/firefly-iii/releases/download/" substr($2, 2, length($2)-3) "/FireflyIII-" substr($2, 2, length($2)-3) ".zip"}') \
; curl -L -o firefly-iii.zip $latestversion
#Install latest version
unzip firefly-iii.zip -x "storage/*" -d /var/www/firefly-iii
cd firefly-iii
yes | composer install --no-scripts --no-dev
yes | composer install --no-dev
php artisan migrate --seed
php artisan firefly-iii:decrypt-all
php artisan cache:clear
php artisan firefly-iii:upgrade-database
php artisan passport:keys
php artisan cache:clear
#Serve next version, make sure rights are ok, restart apache2
cd ..
chown -R www-data:www-data firefly-iii
chmod -R 775 firefly-iii/storage
sleep 5
service apache2 restart
rm firefly-iii.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment