ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    How to upgrade Snipe-IT on CentOS 7 that did not use git

    IT Discussion
    snipe-it upgrade
    4
    9
    3.5k
    Loading More Posts
    • 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.
    • JaredBuschJ
      JaredBusch
      last edited by

      If you installed Snipe-IT on CentOS 7 with the install.sh script as recommended on their website prior to July 13, 2017, then your install did not use git to pull the code down.

      This makes it quite a bit more annoying to update than if you used git.

      Here is a quick little guide on how to get your system switched to using git.

      git clone https://github.com/snipe/snipe-it temp
      rm -rf /var/www/html/snipeit/.git*
      mv temp/.git* /var/www/html/snipeit/
      rm -rf temp/
      cd /var/www/html/snipeit/
      git reset --hard origin/master
      git pull --force
      chown -R apache:apache /var/www/html/snipeit/
      

      Now that the code is updated, you need to run these commands as the apache user. This is normal for all upgrades and is in their guide.
      https://snipe-it.readme.io/docs/upgrading

      sudo -u apache php composer.phar install --no-dev --prefer-source
      sudo -u apache php composer.phar dump-autoload
      sudo -u apache php artisan migrate
      sudo -u apache php artisan config:clear
      sudo -u apache php artisan config:cache
      

      Before: 0_1500062315635_0d32ada8-23b6-4d03-961a-ff5db4513e85-image.png

      After: 0_1500062327800_1116557d-cb20-4bc0-a359-62eacbaf4a4d-image.png

      1 Reply Last reply Reply Quote 7
      • JaredBuschJ
        JaredBusch
        last edited by JaredBusch

        Going forward all you will ever need to do is:

        cd /var/www/html/snipeit
        git pull
        chown -R apache:apache /var/www/html/snipeit/
        sudo -u apache php composer.phar install --no-dev --prefer-source
        sudo -u apache php composer.phar dump-autoload
        sudo -u apache php artisan migrate
        sudo -u apache php artisan config:clear
        sudo -u apache php artisan config:cache
        
        1 Reply Last reply Reply Quote 4
        • DustinB3403D
          DustinB3403
          last edited by

          Used this process today and the update went smoothly.

          JaredBuschJ 1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @DustinB3403
            last edited by

            @dustinb3403 said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

            Used this process today and the update went smoothly.

            I hope so. I never post instructions that I have not done twice.

            Once to write the instructions. then once following the instructions.

            1 Reply Last reply Reply Quote 2
            • AmbarishrhA
              Ambarishrh
              last edited by

              @JaredBusch
              I just tried to upgrade my snipeit version and got an error

              php artisan migrate
              **************************************
              *     Application In Production!     *
              **************************************
              
               Do you really wish to run this command? (yes/no) [no]:
               > y
              
              
              
                [Illuminate\Database\QueryException]
                SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'locale' (SQL: ALTER TABLE users CHANGE locale locale VARCHAR(10) DEFAULT 'en_US.UTF-8' COLLATE utf8_unicode_ci)
              
              
              
                [Doctrine\DBAL\Driver\PDOException]
                SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'locale'
              
              
              
                [PDOException]
                SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'locale'
              
              

              Anyone came across such issue?

              1 Reply Last reply Reply Quote 0
              • AmbarishrhA
                Ambarishrh
                last edited by

                @ambarishrh said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                Invalid default value for 'locale'

                I just updated .env and added APP_LOCALE=en executed again and it worked!

                JaredBuschJ 1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @Ambarishrh
                  last edited by

                  @ambarishrh said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                  @ambarishrh said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                  Invalid default value for 'locale'

                  I just updated .env and added APP_LOCALE=en executed again and it worked!

                  I never go that, it might be related to 4.

                  RomoR 1 Reply Last reply Reply Quote 0
                  • RomoR
                    Romo @JaredBusch
                    last edited by

                    @jaredbusch said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                    @ambarishrh said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                    @ambarishrh said in How to upgrade Snipe-IT on CentOS 7 that did not use git:

                    Invalid default value for 'locale'

                    I just updated .env and added APP_LOCALE=en executed again and it worked!

                    I never go that, it might be related to 4.

                    It is step 7 of the upgrade process to version 4.
                    0_1507561694317_Screenshot from 2017-10-09 10-07-33.png

                    1 Reply Last reply Reply Quote 2
                    • JaredBuschJ
                      JaredBusch
                      last edited by

                      I have not upgraded any of my systems to 4 yet. Glad to see my supposition was correct.

                      1 Reply Last reply Reply Quote 1
                      • 1 / 1
                      • First post
                        Last post