From DreamFactory
Jump to: navigation, search
m (Drewpearce moved page Upgrades to DreamFactory:Upgrades)
m (Drewpearce moved page DreamFactory:Upgrades to DreamFactory/Upgrades)
(No difference)

Revision as of 18:21, 17 May 2016


DreamFactory instances use Git, Composer, and Artisan (a component of Laravel) to move from one version to another. Typically, this is for upgrading, though you could use this procedure to move to older versions of the software as well.

Important Notes (read before starting)

  1. Windows users need to have Git shell for these procedures, such as Git for Windows
  2. Install Directory
    • References to Install Directory or {install directory} refer to the top level directory that houses the actual DreamFactory code.
    • For manual installs this would be where you cloned the DreamFactory git repo, such as /opt/df2
    • For Bitnami installs this is the htdocs folder within the Bitnami installation. Here are the default locations for each operating system, where x.x.x-x represents the version and release number.
    • Unless otherwise noted all commands should be run from the install directory
      • Linux: ~/dreamfactory-x.x.x-x/apps/dreamfactory/htdocs
      • Mac OS X: /Applications/dreamfactory-x.x.x-x/apps/dreamfactory/htdocs
      • Windows: /c/Bitnami/dreamfactory-x.x.x-d/apps/dreamfactory/htdocs
  3. PHP
    • Commands that use the PHP executable can be completed 2 different ways depending on install type. For instance if you are using the artisan migrate command:
    • For manual installs and Bitnami CLOUD images, php should be installed as a system command. You simply call it by name:
      $ php artisan migrate --seed
    • For Bitnami LOCAL installs, you must put the full path to the php executable file. The defaults for each OS are:
      • Linux:
        $ ~/dreamfactory-x.x.x-x/php/bin/php artisan migrate --seed
      • Mac OS X:
        $ /Applications/dreamfactory-x.x.x-x/php/bin/php artisan migrate --seed
      • Windows:
        $ /c/Bitnami/dreamfactory-x.x.x-d/php/php artisan migrate --seed
    • You will need to adjust the instructions below to fit your scenario
  4. Composer
    • Commands that user Composer can be completed 2 different ways depending on install type. For instance, if you are performing composer install:
    • For manual installs , you likely installed composer as a system command:
      $ composer install --no-dev
    • For Bitnami installs, (or if you only installed the composer.phar file locally) you must use PHP to call composer:
      $ php composer.phar install --no-dev
    • You will need to adjust the instructions below to fit your scenario

Perform a Backup

  1. Before upgrading or switch versions you should make a backup of your environment
  2. Backup Files
    • In your shell navigate to one level above the Install Directory
    • Make a copy of the install directory
      • $ cp -r {install directory} {install directory}.backup
    • In the unlikely event of a severe issue, you can restore this file backup
  3. Backup Database
    • Use your database tool of choice to make a complete backup of the database, such as phpMyAdmin, which comes packaged with the Bitnami installers.
    • In the unlikely event of a severe issue, you can restore this database backup

Perform the Upgrade

  1. Navigate to the Install Directory in your shell
  2. Make sure you've checked out the appropriate git tag
    • If you're updating to the latest version, you'll checkout the master tag. If you're moving to a specific version number, you'll checkout that version number as the tag
    • $ git checkout master
  3. Pull the latest from git (again, using the appropriate tag -- master or version number)
    • $ git pull origin master
  4. Reset permission on storage/ and bootstrap/cache/
    • Bitnami local installs can skip this step. Bitnami Cloud images, VMs, and Manual install will typically need to perform this step
    • $ sudo chown -R {web service user}:{your user group} storage/ bootstrap/cache/
    • $ sudo chmod -R 2775 storage/ bootstrap/cache/
  5. Use Composer to update all the vendor repos
    • $ composer install --no-dev
  6. Migrate the database
    • $ php artisan migrate --seed
  7. Clear the application cache
    • $ php artisan cache:clear
  8. Restart your web server process
    • For Bitnami Local installs, use the GUI Bitnami Manager app to restart Apache
    • For Bitnami Cloud and VMs, use the control script
      • $ sudo ../../../ctlscript.sh restart
    • For Manual installs use your OS service management utility to restart Apache or PHP-FPM and Nginx (depending on which tool you're using.)