Update SnipeIT
Guide: Update SnipeIT
Step 1: Navigate to the Code Directory
Change to the directory where your SnipeIT code is located.
cd /var/www/snipeit/
Step 2: Handle Code Changes
If there are any changes to the code, save the modified files. Run the following bash commands to discard changes before pulling the new code:
git reset --hard # Discard all local changes
git fetch origin main # Fetch the latest changes from the repository
sudo -u www-data git pull # Pull the latest code to your machine
sudo -u www-data git checkout tags/v6.4.2 # Select the desired version to upgrade (using tags)
Step 3: Update File and Folder Permissions
Ensure the correct permissions are set for the SnipeIT code files and folders:
sudo chown -R snipeitapp:www-data /var/www/html/snipeit
Step 4: Clear Cache and Reconfigure
Clear the cache and run the necessary configuration commands:
sudo -u www-data php composer.phar install --no-dev --prefer-source
sudo -u www-data php composer.phar dump-autoload
sudo -u www-data php artisan migrate
sudo -u www-data php artisan config:clear
sudo -u www-data php artisan route:clear
sudo -u www-data php artisan cache:clear
sudo -u www-data php artisan view:clear
Step 5: Restart Apache Server
Finally, restart the Apache server to apply the changes:
sudo systemctl restart apache2