Upgrading to ME 1.22
Important Upgrade Notes
Elentra ME 1.22 introduces Laravel Task Scheduling to the platform. See more on how to configure it.
Part 1: Source Code Update
From within Sourcetree on your developer workstation, open your existing local Elentra ME Branded Edition (i.e.,
uni-elentra-1x-me) repository.If you do not currently have a
consortiumGit remote that points to the Consortium Editionelentra-1x-merepository, then ensure that you add one:git remote add consortium [email protected]:ElentraProject/elentra-1x-me.gitClick the "Fetch" button (ensuring that "Fetch from all remotes" and "Prune tracking branches no longer present on remote(s)" options are checked) or type
git fetch consortium.Checkout your Branded Edition staging branch (e.g.,
uni/staging) and create a new branch based on this branch (e.g.,uni/staging-pre-1220) just for easy restore purposes in case it's needed. Once that branch has been created, checkout the original Branded Edition staging branch (e.g.,uni/staging) and continue.Within the "Remotes" section in Sourcetree sidebar, expand the
consortiumremote, then right click onrelease/1.22and clickPull consortium/release/1.22 into uni/staging. At this point, you may be asked to resolve any merge conflicts that have been created by making modifications to your Branded Edition that conflict with changes that have been made to the Consortium Edition. Depending on your level of conflict, this could be as simple as a minor modification to thecomposer.lockfile or something much more complex. If you require assistance, please book an appointment with the Elentra Consortium Core Team, or chat with us on Slack in the #developers channel and we will provide you with guidance or assistance on moving forward. Generally speaking, we always recommend that Consortium Participants follow the Contribution best practices defined in our documentation, which may help reduce the number of conflicts that you encounter.Once the merge conflicts have been resolved, commit the merge to your
uni/stagingbranch and continue to Part 2 of the instructions.
We recommend against pushing your changes to your origin remote at this point. Wait until Part 2 has been completed and you have finished some initial testing on your local developer environment.
Updating a Branded Edition Elentra API
To update your Branded Edition Elentra API, first clone or checkout the compatible version of your Branded Edition Elentra API to your local environment using a git tool like Sourcetree. To find the required version, please consult the Compatibility Matrix.
Click the "Fetch" button (ensuring that "Fetch from all remotes" and "Prune tracking branches no longer present on remote(s)" options are checked) or type
git fetch consortium.Within the "Remotes" section in Sourcetree sidebar, expand the
consortiumremote, then right click on the identified branch from step 1 (i.e. compatible version listed in Compatibility Matrix) and clickPull consortium/<branch> into <Deployed Branch>. There may be merge conflicts that must be resolved if customizations made to your Branded Edition Elentra API.Resolve any merge conflicts and commit the changes to the
masterbranch of your Branded Edition Elentra API. Push these changes to youroriginremote.Using Sourcetree, create a new tag that follows semantic versioning. For example at the time of writing, the latest tagged release of the api is
v5.3.0and thecomposer.jsonprovided with Elentra ME 1.22 specifies that the major version of API version must be~5.0. Create a new tag where the current date follows the patch version:5.3.0.20210903. More information about tagging API releases can be found here.Finally, ensure that within your new Deployer deployment recipe (
deploy.php) that you set theenabled_branded_apioption totrueand the deployment script will take care of the rest during deployment.
Part 2: Settings and Branding Update
During every major Elentra ME version upgrade, you are required to compare:
The stock settings.inc.php file with each environmental settings file in use.
The www-root/templates/default template directory with each Branded Edition customized template within the www-root/templates directory.
Failure to accurately compare and update all environmental settings files and customized templates will result in a non-functional or semi-functional installation of Elentra ME. If you have questions or require assistance, please contact the Elentra Consortium Core Team.
Using a tool like Araxis Merge or Meld, compare
www-root/core/config/settings.inc.phpwith each environmental settings file in thewww-root/core/configdirectory (e.g.,settings-staging.inc.php,settings-production.inc.php). When you compare the Consortium Editionsettings.inc.phpfile with your Branded Edition files, you are looking to add additional settings that have been added to the stocksettings.inc.phpfile and remove any settings that have been removed from the stocksettings.inc.phpfile. In most cases, your Branded Edition settings files should have the same lines (albeit potentially different settings values) as the Consortium Edition. Once you have compared your settings files, commit the changes to youruni/stagingbranch.Using a tool like Araxis Merge or Meld, compare the
www-root/templates/defaultdirectory with each Branded Edition customized template in thewww-root/templatesdirectory (e.g.,www-root/templates/uni). In most cases, you will want to add missing files, update your language files, examine each modification to the CSS files, and add any modifications to yourheader.tpl.phpfiles. This process can take some time depending on the level of change in your implementation, and should be repeated for each template you have created. Once you have compared your templates, commit the changes to youruni/stagingbranch.
Part 3: Testing Locally
Now that you have upgraded your source code and updated your settings and templates. You should begin reviewing and testing the upgrade on your developer workstation. Before testing can begin we need to do a few things.
Log into your local
elentra-developerDocker container, and change to youruni-elentra-1x-medirectory:docker exec -it elentra-developer bash cd /var/www/vhosts/uni-elentra-1x-meEnsure that the latest Composer dependencies installed:
composer installEnsure that the database migrations are completed:
php elentra migrate --upProviding these steps were successful, you should now be able to visit https://uni-elentra-1x-me.localhost in your web browser and being your local upgrade review.
At this point, providing you're satisfied with your local testing, we would recommend that you push your changes to your origin remote.
Part 4: Updating Deployment Strategy
The following transition instructions are to be used as reference-only, as there may be unique circumstances within your existing deployment recipe to be considered.
Step 1: Copy Deployer template files into your Branded Edition repository
Download the raw .deployignore and deploy.php files from the Elentra Developer GitHub Repository and place them in your ~/Sites/uni-elentra-1x-me/deployment directory
Step 2: Update the values in the Deployer recipe template
Open the Deployer ("Dep") deployment/deploy.php deployment recipes in your editor or IDE. There are a few variables at the top of deploy.php that need to be set. The following table describes variable names that must set.
Variable Name
Description
application
Application Name (e.g., uni-elentra-1x-me)
packagist_token
Institutional Packagist.com Composer token
repository
Branded Edition Elentra ME Git repository location
branch
The default deployment branch (e.g., master) within your Branded Edition Elentra ME Git repository. This value is always overridden by the host configuration section (if present), so it not overly important.
repository_ejs
Default recommended.
This can be left as-is unless you have a Branded Edition Elentra JS Git repository.
branch_ejs
Default recommended.
This can be left as-in unless you have a Branded Edition Elentra JS Git repository. This value is always overridden by the host configuration section (if present), so it not overly important.
enable_branded_api
Default value is false.
If you have a Branded Edition Elentra API with your implementation of Elentra then please set this to true
Once you have configured all of the variables correctly, the next step is to translate the hosts configuration. The following section illustrates a single staging server and multiple production server transition.
Example Deployer (deploy.php) Recipe Host configuration
# Elentra ME
// Staging Server
host('elentra-staging.med.university.edu')
->stage('staging')
->user('staging')
->set('branch', 'uni/staging')
->set('branch_ejs', 'develop')
->set('deploy_path', '/var/www/vhosts/elentra-staging.med.university.edu')
->roles('app')
->forwardAgent();
// Production Server
host('elentra01.med.university.edu', 'elentra02.med.university.edu')
->stage('production')
->user('production')
->set('branch', 'uni/production')
->set('branch_ejs', 'master')
->set('deploy_path', '/var/www/vhosts/elentra.med.university.edu')
->roles('app')
->forwardAgent();Step 3: Review Deployment Commands
The typical deployment commands used by institutions are referenced below, but please see the Elentra Deployment documentation for a full list of all commands available.
The Deployer deployment strategy transition should require no Apache configuration changes and was designed to be fully backwards compatible with older Capistrano recipes.
Deployer
Capistrano
dep deploy staging
cap staging deploy
dep deploy production
cap production deploy
dep rollback staging
cap staging deploy:rollback
Part 5: Testing on Staging
Providing that you have pushed the changes to your uni/staging branch to your origin remote, you can now deploy the upgrade to your staging environment from within your Docker container.
Log into your local
elentra-developerDocker container, and change to yourdeploymentdirectory:docker exec -it elentra-developer bash cd /var/www/vhosts/uni-elentra-1x-me/deploymentDeploy changes to your staging server using the new Deployer deployment recipe:
dep deploy stagingProviding the deployment was successful, you should now be able to visit https://elentra-staging.med.university.edu in your web browser to begin a thorough review of your upgraded Branded Edition implementation of Elentra ME.
Part 6: Deploy to Production
Providing that you have thoroughly tested your upgraded Branded Edition implementation of Elentra ME on within your staging environment, it is safe to proceed with a production upgrade.
From within Sourcetree on your developer workstation, open your existing local Elentra ME Branded Edition (i.e.,
uni-elentra-1x-me) repository.Checkout your
uni/productionbranch.Right click on your
uni/stagingbranch and click "Merge uni/staging into uni/production". This will merge all of the commits that have gone into creating the upgrade, into youruni/productionbranch.Push the commits in the
uni/productionbranch to youroriginremote. Log into your localelentra-developerDocker container, and change to yourdeploymentdirectory:docker exec -it elentra-developer bash cd /var/www/vhosts/uni-elentra-1x-me/deploymentDeploy changes to your production server using the new Deployer deployment recipe:
dep deploy productionProviding the deployment was successful, you should now be able to visit https://elentra.med.university.edu in your web browser and verify that you are now running the latest version of Elentra ME.
Important Changes
Laravel Task Scheduling
The Laravel task scheduler should be configured to run on a default schedule of once every minute by adding the line following line to your crontab:
* * * * * php /var/www/vhosts/host.name.edu/current/www-root/core/library/vendor/elentrapackages/elentra-1x-api/artisan schedule:run >> /dev/null 2>&1Last updated