TurnKey + Snipe-IT, export all assets to CSV file but missing some record, but the database is correct

At 2022-Sept, the User report tries to export all assets to a CSV file at Snipe-IT but missing some asset records. ( but the asset record is showing on Snipe-IT web UI ) so I search it on the database, but it works...... so I think it is PHP or  Snipe-IT problem. When I try to submit a support ticket to Snipe-IT, that reminds me: update to the last version, but I am using an all-in-one TurnKey Linux version, so I try to update Snipe-IT with git actions.

1/ backup system, the TurnKey + Snipe-IT is running on Proxmox, so just using Proxmox Backup Server to make a full backup.

2/Open Shell, rename the current Snipe-IT directory and clone the latest version via git.

cd /var/www

mv snipe-it snipe-it-backup

git clone https://github.com/snipe/snipe-it

3/Upgrade PHP to the new version

sudo apt install apt-transport-https lsb-release
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt-get update && sudo apt-get upgrade

4/Change apache run PHP new version

a2dismod php7.3
a2enmod php8.1
systemctl restart apache2

5/ Fix permissions, enter the snipe-it dir and install dependencies with composer:

chown -R www-data:www-data snipe-it 
cd snipe-it 
turnkey-composer install --no-dev --prefer-source

6/When it's done, copy in the required old files:

cp -R ../snipe-it-backup/public/uploads/* public/uploads 
cp -R ../snipe-it-backup/storage/private_uploads/* storage/private_uploads 
cp -R ../snipe-it-backup/storage/app/backups/* storage/app/backups 
cp -R ../snipe-it-backup/.env ./ 
cp -R ../snipe-it-backup/storage/oauth-private.key storage/oauth-private.key 
cp -R ../snipe-it-backup/storage/oauth-public.key storage/oauth-public.key

7/Migrate DB, clear cache

runuser - www-data -s /bin/bash -c "cd /var/www/snipe-it && php upgrade.php"

8/ Done


Reference

Upgrade Snipe-IT | TurnKey GNU/Linux
I just discovered that Aleksand posted on GitHub asking about how to update Snipe-IT. Rather than answer there, I thought I’d post here instead. Please note that this only applies to a v16.x server, future releases (i.e. v17.0 or later) should be easy as the line line of this post... (TBC) Reading t…
David Yuen

David Yuen

Hong Kong