Upgrading Dreamfactory within Gold
Upgrade Procedure
DreamFactory Gold is a multi-tenant system where multiple instances share the same codebase, but with separate DBs. To upgrade the DreamFactory codebase, you will need to update the actual code as well as run any migrations and / or seeds against the individual instance databases.
Once you're in your DreamFactory Gold instance, you'll need access to /var/www/launchpad.
First, we will upgrade the DreamFactory "Base" installation for all of your Gold instances. Navigate to /var/www/launchpad
- 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
- If you have unsaved changes, you'll receive a message indicating which files have changes in them. You will need to stash the changes.
- You must do this step BEFORE checkout if you have made changes to or replaced any files in the main DreamFactory repo (such as changes to composer.json.)
-
$ git stash
- Repeat the checkout step.
- Pull the latest from git (again, using the appropriate tag -- master or version number).
-
$ git pull origin master
-
$ sudo chmod -R 2775 storage/ bootstrap/cache/
-
- Use Composer to update all the vendor repos.
-
$ composer install --no-dev
-
- Migrate the database.
-
$ php artisan migrate --seed
-
- Clear the application cache.
-
$ php artisan cache:clear
-
Now that the base launchpad directory has been upgraded, you still will need to perform some of these actions on your DreamFactory instances. This is done by a process we call "encapsulation". It basically mounts an individual instance to a temporary location so you can perform actions from the shell on it.
Now change your directory to /var/www/console
$ cd /var/www/console
Create the encapsulation
$ sudo php artisan dfe:capsule <instance-name>
You will receive a directory location based on your Gold install setup to navigate to. This is the encapsulation point.
* Instance "instance" encapsulated in /data/capsules/mycluster/instance.
Navigate to this directory. From there you can perform upgrade operations on an individual instance. This is necessary when there are database migrations and additional seeds which need to be applied to the instance's database.</br> From the capsule directory:
$ sudo php artisan cache:clear $ sudo php artisan config:clear $ sudo php artisan migrate --seed
After the migrations have run, you will need to remove the capsule mount. Navigate back to the /var/www/console directory.
$ sudo php artisan dfe:capsule <instance name> --destroy
This will clean up and remove the capsule mount. Repeat the above steps for all the instances on your Gold Cluster.