Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snipe-IT v7 upgrade not possible on Debian without PHP 8.2 support in v6.4 #14977

Closed
2 tasks done
cjs59 opened this issue Jun 26, 2024 · 5 comments
Closed
2 tasks done

Comments

@cjs59
Copy link

cjs59 commented Jun 26, 2024

Debug mode

Describe the bug

It is not possible to directly upgrade Snipe-IT from v6 to v7 on a Debian server without a third-party version of PHP, because Debian 11 includes PHP 7.4 (compatible with Snipe-IT v6 but not v7), and Debian 12 includes PHP 8.2 (compatible with Snipe-IT v7 but not v6). To get my server upgraded I had to install a temporary copy of PHP 8.1.

Reproduction steps

  1. Install a Debian 11 (bullseye) server with PHP 7.4
  2. Install Snipe-IT v6.4.2 via git clone
  3. Upgrade the server to Debian 12 (bookworm) with PHP 8.2 as per https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html
  4. The Snipe-IT web interface fails with 500 server errors - presumably because the dependencies need updating
  5. "php upgrade.php v6.4.2" fails because PHP is too new
  6. "php upgrade.php v7.0.6" fails because the dependencies are broken
  7. Install the PHP 8.1 packages from https://deb.sury.org/ and set 8.1 to be the default PHP version
  8. "php upgrade.php v6.4.2" succeeds
  9. "php upgrade.php v7.0.6" succeeds
  10. Uninstall the temporary PHP 8.1 packages
  11. "php upgrade.php v7.0.6" succeeds

Expected behavior

It would be better for anyone else trying to do the same upgrade if there was a Snipe-IT 6.4.x which supported PHP 8.2, and so they could follow the straightforward procedure:

  1. On Debian 11, upgrade 6.4.2 to 6.4.x
  2. Upgrade the server to Debian 12
  3. Upgrade 6.4.x to 7.0.6

Screenshots

No response

Snipe-IT Version

6.4.2 + 7.0.6

Operating System

Debian 11 + 12

Web Server

Apache

PHP Version

7.4.33 + 8.2.20

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

@snipe
Copy link
Owner

snipe commented Jun 26, 2024

A git pull to pull down the latest requirements would probably fix this? It's a bit shit because it's a sandwich we knew we were going to be in. But I think that should sort you.

Try:

git pull
php composer install --no-dev --prefer-source
php composer.phar dump-autoload
php artisan migrate
php artisan config:clear
php artisan route:clear
php artisan cache:clear
php artisan view:clear

@cjs59
Copy link
Author

cjs59 commented Jun 27, 2024

My main installation is already upgraded - upgrade.php worked when it was being run under the temporary installation of PHP 8.1, and after that it worked on the system PHP 8.2.

I've just set up a test VM with Snipe-IT installed by "git clone" followed by "git checkout v6.4.2". upgrade.php failed on "STEP 4: Backing up database:" and aborted the process. The following sequence of commands did work:

  1. git checkout v7.0.6
  2. composer install --no-dev --prefer-source
  3. composer dump-autoload
  4. php artisan migrate
  5. php artisan config:clear
  6. php artisan route:clear
  7. php artisan cache:clear
  8. php artisan view:clear

Could you add this scenario of upgrading across incompatible PHP versions to the common issues page?

@snipe
Copy link
Owner

snipe commented Jun 27, 2024

We already kinda do have that covered in the upgrade guide tho, no? https://snipe-it.readme.io/docs/upgrading

Snipe-IT Documentation
🚧If you run into any issues upgrading...Please check the Common Issues > Installation/Upgrading Issues section which provides solutions for commonly encountered installation / upgrading problems. Always backup your database and .env file before upgrading. We try very hard to make sure that all d...

@cjs59
Copy link
Author

cjs59 commented Jul 1, 2024

The "After Pulling the New Version Files" section does have that general procedure, though I need to combine the two shell blocks with /usr/bin/composer rather than composer.phar on Linux. However it doesn't say that that's a sensible alternative to try if upgrade.php fails (particularly when you've just done a significant OS upgrade) and that the manual process is unlikely to cause problems for using upgrade.php in future.

@snipe
Copy link
Owner

snipe commented Jul 2, 2024

We'll get those docs updated, thanks

@snipe snipe closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants