Upgrading¶
This page describes how to upgrade an existing BFUS integration. The upgrade procedure differs depending on the current installation and server version.
Upgrading to 2.3.0¶
In this versin there is a fix for flexservice, if your customer is using flexservice and flexserviceplace, apply this patch. If not can be ignored. In lisa create the following fields on the flexservice object.
bfus_flexserviceplaceid:
type: string
label: none
required: false
length: 64
defaultvalue: ''
bfus_periodstartdate:
type: string
label: none
required: false
length: 64
defaultvalue: ''
bfus_periodenddate:
type: string
label: none
required: false
length: 64
defaultvalue: ''
Add the following code to limeobject_flexservice.py.
import addon_bfus_integration.tasks.flexservice_link_flexplace as bfus_flex
def after_update(self, unsaved_self, **kwargs):
super().after_update(unsaved_self, **kwargs)
bfus_flex.check_bfus_fix_flexservice(unsaved_self, self)
Upgrading to 2.1.0¶
Fetching yearly consumption from BFUS is now a Lime Task. This means no more scheduling task with the Windows Task Scheduler and by that also cloud support (Yeay! 🎉🙂).
- Schedule the task in your customer solution. (usually nightly on the first of each month)
- Create/Reuse a user that can run the task.
Example¶
def register_scheduled_tasks():
bfusapiuser_task_session = TaskSession(user_name="bfusapiuser", language="sv")
return [
ScheduledTask(
task=yearly_consumption_tasks.trigger_yearly_consumption_task,
schedule=CronTab(day_of_month=1, hour=2),
args=[],
session=bfusapiuser_task_session,
),
]
- Configuration:
- Add configuration to application_config.yaml OR
- CAFE
<Insert-Customer-Application-Name-Here>:
config:
addon_bfus_integration:
yearlyconsumption:
bfus_url_base_path: <BFUS-BASE-URL-WITH-PORT-NBR>
yearlyconsumption_days: 365
secrets:
addon_bfus_integration:
yearlyconsumption:
bfus_api_key: <BFUS-API-KEY>
- (Optional but recommended) Add the task to the task-starter if the customer has that limepkg.
<Insert-Customer-Application-Name-Here>:
config:
limepkg_task_starter:
tasks:
- addon_bfus_integration.tasks.yearly_consumption_tasks.trigger_yearly_consumption_task
Upgrading to 2.x.y¶
- Change the version of the dependency
addon-bfus-integration
in your solution'spyproject.toml
file. - Run
poetry lock
- (Optional) Review commits in bfus_template_solution compared to the customer solution. Add new mandatory changes, and/or, add new logic which the customer wants or needs.
- Build and deploy your solution.
- Enable the integration mapping in Lime Admin for each limetype and start mapping. It is important to have at least the minimum required config when upgrading to 2.x.y or else the integration will fail. You can either import this configuration in limeadmin: BFUS 2.0 Lime Admin required config OR: Go though each limetype in the Lime Admin mapping, enable and disable the Activate Lime Admin mappning-checkbox and save.
If the customer has existing mapping in the solution (bfus_mapping.py) this can now be moved to Lime Admin instead. (NOTE! Not all limetypes are supported yet so do not remove the existing bfus_mapping.py file from the solution.)
Upgrading the Python version in a poetry solution¶
- Change the version of the dependency
addon-bfus-integration
in your solution'spyproject.toml
file. - Review commits in bfus_template_solution compared to the customer solution. Add new mandatory changes, and/or, add new logic which the customer wants or needs.
- Build and deploy your solution.
Upgrading from the SQL version to the Python version¶
If upgrading from the SQL version of the BFUS Integration go through the installation instructions.