SpineOpt major_upgrade_1 migration reference

Scope and interpretation

This document records the migrations declared and performed by major_upgrade_1 in the supplied Julia script. It distinguishes simple renaming (same class/dimensions, parameter or class/list name changes) from restructuring (dimension reordering, moving parameters to new classes, superclass creation, and changes to value-list semantics). It is based on the script, not on a comparison of a particular database before and after migration.

Migration order matters: the script creates superclasses/subclasses, reorders classes, scales selected values, renames parameters/classes, moves multidimensional parameters, removes obsolete classes/parameters, renames lists and list values, merges variable-type lists, moves node physics settings to grid physics, then checks values against the latest template lists.

1. Simple renaming

1.1 Parameter renames

Unless noted, each mapping renames a parameter definition and its values in the same entity class. If the target parameter already exists, the script merges the old definition into it; migrated attributes and values take precedence, while other existing values are retained. Values in the same alternative are overwritten by migrated values.

Class unit

Old parameterNew parameterNotes
number_of_unitsexisting_units
fix_units_out_of_serviceout_of_service_count_fix
initial_units_out_of_serviceout_of_service_count_initial
scheduled_outage_durationoutage_scheduled_duration
unit_availability_factoravailability_factor
units_unavailableout_of_service_count_fixValues are summed into the target parameter, then the old parameter is removed.
fix_units_ononline_count_fix
initial_units_ononline_count_initial
unit_decommissioning_timedecommissioning_time
unit_discount_rate_technology_specificdiscount_rate_technology_specific
unit_investment_econ_lifetimelifetime_economic
unit_investment_tech_lifetimelifetime_technical
unit_investment_lifetime_senselifetime_constraint_sense
unit_investment_variable_typeinvestment_variable_type
unit_lead_timelead_time
candidate_unitsinvestment_count_max_cumulative
fix_units_investedinvestment_count_fix_new
fix_units_invested_availableinvestment_count_fix_cumulative
initial_units_investedinvestment_count_initial_new
initial_units_invested_availableinvestment_count_initial_cumulative
units_invested_big_m_mgamga_investment_big_m
units_invested_mgamga_investment_active
units_invested_mga_weightmga_investment_weight

Class node

Old parameterNew parameterNotes
has_statestorage_active
fractional_demanddemand_fraction
min_capacity_margincapacity_margin_min
min_capacity_margin_penaltycapacity_margin_penalty
nodal_balance_sensebalance_sense
node_slack_penaltybalance_penalty
frac_state_lossstorage_self_discharge
number_of_storagesexisting_storages
state_coeffstorage_state_coefficient
storage_fom_coststorage_fixed_annual_cost
is_longterm_storagestorage_longterm_active
fix_node_statestorage_state_fix
initial_node_statestorage_state_initial
node_state_capstorage_state_max
node_state_minstorage_state_min
node_availability_factorstorage_state_max_fraction
node_state_min_factorstorage_state_min_fraction
fix_node_pressurepressure_fix
initial_node_pressurepressure_initial
max_node_pressurepressure_max
min_node_pressurepressure_min
fix_node_voltage_anglevoltage_angle_fix
initial_node_voltage_anglevoltage_angle_initial
max_voltage_anglevoltage_angle_max
min_voltage_anglevoltage_angle_min
storage_investment_econ_lifetimestorage_lifetime_economic
storage_investment_tech_lifetimestorage_lifetime_technical
storage_investment_lifetime_sensestorage_lifetime_constraint_sense
candidate_storagesstorage_investment_count_max_cumulative
fix_storages_investedstorage_investment_count_fix_new
fix_storages_invested_availablestorage_investment_count_fix_cumulative
initial_storages_investedstorage_investment_count_initial_new
initial_storages_invested_availablestorage_investment_count_initial_cumulative
storages_invested_big_m_mgamga_storage_investment_big_m
storages_invested_mgamga_storage_investment_active
storages_invested_mga_weightmga_storage_investment_weight
downward_reservereserve_downward
upward_reservereserve_upward
is_reserve_nodereserve_active

Class connection

Old parameterNew parameterNotes
connection_availability_factoravailability_factor
connection_contingencycontingency_active
connection_monitoredmonitoring_active
connection_reactancereactance
connection_reactance_basereactance_base
connection_resistanceresistance
number_of_connectionsexisting_connections
has_binary_gas_flowbinary_gas_flow_active
connection_decommissioning_costdecommissioning_cost
connection_decommissioning_timedecommissioning_time
connection_discount_rate_technology_specificdiscount_rate_technology_specific
connection_investment_econ_lifetimelifetime_economic
connection_investment_lifetime_senselifetime_constraint_sense
connection_investment_tech_lifetimelifetime_technical
connection_investment_variable_typeinvestment_variable_type
connection_lead_timelead_time
candidate_connectionsinvestment_count_max_cumulative
fix_connections_investedinvestment_count_fix_new
fix_connections_invested_availableinvestment_count_fix_cumulative
initial_connections_investedinvestment_count_initial_new
initial_connections_invested_availableinvestment_count_initial_cumulative
connections_invested_big_m_mgamga_investment_big_m
connections_invested_mgamga_investment_active
connections_invested_mga_weightmga_investment_weight

Class commodity

Old parameterNew parameterNotes
commodity_lodf_tolerancelodf_tolerance
commodity_physicsphysics_type
commodity_physics_durationphysics_duration
commodity_ptdf_thresholdptdf_threshold

Class investment_group

Old parameterNew parameterNotes
equal_investmentsequal_investments_active
maximum_capacity_invested_availableinvestment_capacity_total_max_cumulative
maximum_entities_invested_availableinvestment_count_total_max_cumulative
minimum_capacity_invested_availableinvestment_capacity_total_min_cumulative
minimum_entities_invested_availableinvestment_count_total_min_cumulative

Class model

Old parameterNew parameterNotes
db_lp_solversolver_lp
db_lp_solver_optionssolver_lp_options
db_mip_solversolver_mip
db_mip_solver_optionssolver_mip_options
max_gapdecomposition_max_gap
max_iterationsdecomposition_max_iterations
max_mga_iterationsmga_max_iterations
max_mga_slackmga_max_slack
min_iterationsdecomposition_min_iterations
report_benders_iterationsbenders_iterations_reporting_active
use_connection_intact_flowconnection_investment_power_flow_impact_active
use_highest_resolution_constraint_ratio_out_in_connection_flowconnection_flow_highest_resolution_active
use_tight_compact_formulationstight_compact_formulations_active

Class node__node

Old parameterNew parameterNotes
diff_coeffdiffusion_coefficient

Class node__user_constraint

Old parameterNew parameterNotes
demand_coefficientcoefficient_for_demand
node_state_coefficientcoefficient_for_node_state
storages_invested_available_coefficientcoefficient_for_storages_invested_available
storages_invested_coefficientcoefficient_for_storages_invested

Class unit__to_node

Old parameterNew parameterNotes
fix_unit_flowflow_limits_fix
fix_unit_flow_opflow_limits_fix_op
initial_unit_flowflow_limits_initial
initial_unit_flow_opflow_limits_initial_op
min_unit_flowflow_limits_min
ramp_down_limitramp_limits_down
ramp_up_limitramp_limits_up
shut_down_limitramp_limits_shutdown
start_up_limitramp_limits_startup
unit_capacitycapacity_per_unit
unit_conv_cap_to_flowcapacity_to_flow_conversion_factor

Class node__to_unit

Old parameterNew parameterNotes
fix_unit_flowflow_limits_fix
fix_unit_flow_opflow_limits_fix_op
initial_unit_flowflow_limits_initial
initial_unit_flow_opflow_limits_initial_op
max_total_cumulated_unit_flow_from_nodeflow_limits_max_cumulative
min_total_cumulated_unit_flow_from_nodeflow_limits_min_cumulative
min_unit_flowflow_limits_min
ramp_down_limitramp_limits_down
ramp_up_limitramp_limits_up
shut_down_limitramp_limits_shutdown
start_up_limitramp_limits_startup
unit_capacitycapacity_per_unit
unit_conv_cap_to_flowcapacity_to_flow_conversion_factor

Class unit__user_constraint

Old parameterNew parameterNotes
units_invested_available_coefficientcoefficient_for_units_invested_available
units_invested_coefficientcoefficient_for_units_invested
units_on_coefficientcoefficient_for_units_on
units_started_up_coefficientcoefficient_for_units_started_up

Class unit_flow__user_constraint

Old parameterNew parameterNotes
unit_flow_coefficientcoefficient_for_unit_flow

Class connection__from_node

Old parameterNew parameterNotes
fix_binary_gas_connection_flowbinary_gas_flow_limits_fix
initial_binary_gas_connection_flowbinary_gas_flow_limits_initial
fix_connection_flowflow_limits_fix
fix_connection_intact_flowflow_limits_fix_intact
initial_connection_flowflow_limits_initial
initial_connection_intact_flowflow_limits_initial_intact
connection_capacitycapacity_per_connection
connection_conv_cap_to_flowcapacity_to_flow_conversion_factor

Class connection__to_node

Old parameterNew parameterNotes
fix_binary_gas_connection_flowbinary_gas_flow_limits_fix
initial_binary_gas_connection_flowbinary_gas_flow_limits_initial
fix_connection_flowflow_limits_fix
fix_connection_intact_flowflow_limits_fix_intact
initial_connection_flowflow_limits_initial
initial_connection_intact_flowflow_limits_initial_intact
connection_capacitycapacity_per_connection
connection_conv_cap_to_flowcapacity_to_flow_conversion_factor

Class connection__from_node__user_constraint

Old parameterNew parameterNotes
connection_flow_coefficientcoefficient_for_connection_flow

Class connection__to_node__user_constraint

Old parameterNew parameterNotes
connection_flow_coefficientcoefficient_for_connection_flow

Class connection__user_constraint

Old parameterNew parameterNotes
connections_invested_available_coefficientcoefficient_for_connections_invested_available
connections_invested_coefficientcoefficient_for_connections_invested

Class temporal_block

Old parameterNew parameterNotes
representative_period_indexrepresentative_block_index
representative_periods_mappingrepresentative_blocks_by_period

1.2 Class rename

Old classNew classBehaviour
commoditygridRenames the class. If grid already exists with matching dimensions, the classes are merged and migrated values take precedence; if dimensions differ, the existing target class is replaced.

1.3 Parameter value-list renames

Old listNew list
commodity_physics_listgrid_physics_list
db_lp_solver_listsolver_lp_list
db_mip_solver_listsolver_mip_list

1.4 Value renames inside lists

grid_physics_list (after commodity_physics_list is renamed):

Old valueNew value
commodity_physics_lodflodf_physics
commodity_physics_nonenone
commodity_physics_ptdfptdf_physics

balance_type_list:

Old valueNew value
balance_type_nonenone
balance_type_nodenode_balance
balance_type_groupgroup_balance

Variable-type list migration: unit_online_variable_type_list becomes variable_type_list, with values renamed as follows:

Old valueNew value
unit_online_variable_type_binarybinary
unit_online_variable_type_integerinteger
unit_online_variable_type_linearlinear
unit_online_variable_type_nonenone

That list migration also consolidates investment-variable type handling for unit, connection, and node storage investments; see Variable-type restructuring.

2. Restructuring

2.1 Superclasses and subclasses

The migration ensures user_constraint and investment_group classes exist (creating empty classes if missing), then ensures the following classes exist:

ClassDimensionsPurpose in migration
unit__to_nodeunit, nodeFlow-direction subclass
node__to_unitnode, unitFlow-direction subclass
unit_flownone (0-D superclass)Shared superclass for unit-flow relations
unit_flow__unit_flowunit_flow, unit_flowRelations between two unit flows
unit_flow__investment_groupunit_flow, investment_groupUnit-flow/investment-group relation
unit_flow__user_constraintunit_flow, user_constraintUnit-flow/user-constraint relation

Both unit__to_node and node__to_unit are made subclasses of unit_flow.

2.2 Multidimensional class dimension reordering / migration

The script creates destination classes, copies parameter definitions and values, and also copies entity alternatives and group memberships. The dimension mappings below specify the source dimension order used to construct the destination entity names.

Source classDestination classDestination dimensionsDimension mapping
unit__from_nodenode__to_unitnode, unit[2, 1]
unit__to_node_unit__to_nodeunit, node[1, 2]
unit__from_node__investment_groupunit_flow__investment_groupnode, unit, investment_group[2, 1, 3]
unit__from_node__user_constraintunit_flow__user_constraintnode, unit, user_constraint[2, 1, 3]
unit__to_node__investment_groupunit_flow__investment_groupunit, node, investment_group[1, 2, 3]
unit__to_node__user_constraintunit_flow__user_constraintunit, node, user_constraint[1, 2, 3]

Notes:

  • unit__from_node is converted to node__to_unit by swapping dimensions.
  • unit__to_node_ is converted to unit__to_node; the trailing underscore is an intentional staging step so unit__to_node can be recreated as a subclass of unit_flow.
  • unit__from_node__investment_group and unit__from_node__user_constraint are converted to their unit_flow__... classes with the unit/node dimensions reordered.
  • The unit__to_node__investment_group and unit__to_node__user_constraint classes are also migrated to the same destination classes. These source classes do not print errors for missing parameter definitions during this operation (print_errors=false).
  • Where a destination entity or parameter definition already exists, the migration generally preserves it but lets migrated definitions/values take precedence.

2.3 Parameters moved from unit__node__node to unit_flow__unit_flow

The old unit__node__node class models two node dimensions associated with a unit. The migration maps its parameter values into unit_flow__unit_flow, whose dimensions are two unit-flow entities. The old parameter definitions are removed after each move, and the old class is removed later.

Flow-ratio limits

Old parameterNew parameterDimension mapping
fix_ratio_out_in_unit_flowflow_ratio_equality_coefficient[1, 2, 3, 1]
fix_ratio_in_out_unit_flowflow_ratio_equality_coefficient[2, 1, 1, 3]
fix_ratio_in_in_unit_flowflow_ratio_equality_coefficient[2, 1, 3, 1]
fix_ratio_out_out_unit_flowflow_ratio_equality_coefficient[1, 2, 1, 3]
min_ratio_out_in_unit_flowflow_ratio_greater_than_coefficient[1, 2, 3, 1]
min_ratio_in_out_unit_flowflow_ratio_greater_than_coefficient[2, 1, 1, 3]
min_ratio_in_in_unit_flowflow_ratio_greater_than_coefficient[2, 1, 3, 1]
min_ratio_out_out_unit_flowflow_ratio_greater_than_coefficient[1, 2, 1, 3]
max_ratio_out_in_unit_flowflow_ratio_less_than_coefficient[1, 2, 3, 1]
max_ratio_in_out_unit_flowflow_ratio_less_than_coefficient[2, 1, 1, 3]
max_ratio_in_in_unit_flowflow_ratio_less_than_coefficient[2, 1, 3, 1]
max_ratio_out_out_unit_flowflow_ratio_less_than_coefficient[1, 2, 1, 3]

The four direction suffixes (out_in, in_out, in_in, out_out) map to dimension patterns [1, 2, 3, 1], [2, 1, 1, 3], [2, 1, 3, 1], and [1, 2, 1, 3], respectively. For each direction pattern:

  • fix_ratio_* becomes flow_ratio_equality_coefficient.
  • min_ratio_* becomes flow_ratio_greater_than_coefficient.
  • max_ratio_* becomes flow_ratio_less_than_coefficient.

Unit-online coefficient limits

Old parameterNew parameterDimension mapping
fix_units_on_coefficient_out_inflow_ratio_equality_online_coefficient[1, 2, 3, 1]
fix_units_on_coefficient_in_outflow_ratio_equality_online_coefficient[2, 1, 1, 3]
fix_units_on_coefficient_in_inflow_ratio_equality_online_coefficient[2, 1, 3, 1]
fix_units_on_coefficient_out_outflow_ratio_equality_online_coefficient[1, 2, 1, 3]
min_units_on_coefficient_out_inflow_ratio_greater_than_online_coefficient[1, 2, 3, 1]
min_units_on_coefficient_in_outflow_ratio_greater_than_online_coefficient[2, 1, 1, 3]
min_units_on_coefficient_in_inflow_ratio_greater_than_online_coefficient[2, 1, 3, 1]
min_units_on_coefficient_out_outflow_ratio_greater_than_online_coefficient[1, 2, 1, 3]
max_units_on_coefficient_out_inflow_ratio_less_than_online_coefficient[1, 2, 3, 1]
max_units_on_coefficient_in_outflow_ratio_less_than_online_coefficient[2, 1, 1, 3]
max_units_on_coefficient_in_inflow_ratio_less_than_online_coefficient[2, 1, 3, 1]
max_units_on_coefficient_out_outflow_ratio_less_than_online_coefficient[1, 2, 1, 3]

The same four direction patterns apply. fix_units_on_coefficient_*, min_units_on_coefficient_*, and max_units_on_coefficient_* become, respectively, flow_ratio_equality_online_coefficient, flow_ratio_greater_than_online_coefficient, and flow_ratio_less_than_online_coefficient.

Startup flow

Old parameterNew parameterDimension mapping
unit_start_flowflow_ratio_start_flow[2, 1, 1, 3] (only this input-output mapping is active)

The script contains three additional unit_start_flow mappings in a commented-out block; they are not executed. The comment says enabling the full migration could result in duplicate values.

2.4 Flow parameter renames on flow-direction classes

These parameter renames apply to both unit__to_node and node__to_unit, unless noted.

Old parameterNew parameter
fix_unit_flowflow_limits_fix
fix_unit_flow_opflow_limits_fix_op
initial_unit_flowflow_limits_initial
initial_unit_flow_opflow_limits_initial_op
min_unit_flowflow_limits_min
ramp_down_limitramp_limits_down
ramp_up_limitramp_limits_up
shut_down_limitramp_limits_shutdown
start_up_limitramp_limits_startup
unit_capacitycapacity_per_unit
unit_conv_cap_to_flowcapacity_to_flow_conversion_factor
max_total_cumulated_unit_flow_from_nodeflow_limits_max_cumulative
min_total_cumulated_unit_flow_from_nodeflow_limits_min_cumulative

2.5 Variable-type restructuring

The old unit_online_variable_type_list is renamed to variable_type_list, with its values normalised to binary, integer, linear, and none. The script then creates/uses investment_variable_type2 as an intermediate parameter linked to variable_type_list for:

  • unit.investment_count_max_cumulative / unit.investment_variable_type
  • connection.investment_count_max_cumulative / connection.investment_variable_type
  • node.storage_investment_count_max_cumulative / node.storage_investment_variable_type

If a cumulative investment-count value is nothing, the new type is none; otherwise the class-specific legacy default is used (unit: linear; connection and node storage: integer). An explicitly set old investment-variable type overrides that default: values containing integer become integer, otherwise they become linear. The script also merges legacy variable-type lists into the shared list and updates investment parameter definitions. The detailed list names and temporary definitions are implementation details in the script; the final shared list is variable_type_list.

2.6 Move node physics flags into grid physics

The script migrates boolean node parameters into values of grid_physics_list, creating corresponding grid and node__grid entities as needed:

Old class/parameterNew destinationMapping
node.has_voltage_anglegrid_physics_list value voltage_angle_physicstrue → voltage_angle_physics; false → none
node.has_pressuregrid_physics_list value pressure_physicstrue → pressure_physics; false → none

The new list values are inserted at indices 3 and 4, respectively. This is a semantic move, not merely a parameter rename.

2.7 Connection-flow parameters and user constraints

Parameters on both connection__from_node and connection__to_node are renamed in place as follows:

Old parameterNew parameter
fix_binary_gas_connection_flowbinary_gas_flow_limits_fix
initial_binary_gas_connection_flowbinary_gas_flow_limits_initial
fix_connection_flowflow_limits_fix
fix_connection_intact_flowflow_limits_fix_intact
initial_connection_flowflow_limits_initial
initial_connection_intact_flowflow_limits_initial_intact
connection_capacitycapacity_per_connection
connection_conv_cap_to_flowcapacity_to_flow_conversion_factor

On connection__from_node__user_constraint and connection__to_node__user_constraint, connection_flow_coefficient becomes coefficient_for_connection_flow.

2.8 Additional parameter renames on multidimensional classes

ClassOld parameterNew parameter
node__nodediff_coeffdiffusion_coefficient
node__user_constraintdemand_coefficientcoefficient_for_demand
node__user_constraintnode_state_coefficientcoefficient_for_node_state
node__user_constraintstorages_invested_available_coefficientcoefficient_for_storages_invested_available
node__user_constraintstorages_invested_coefficientcoefficient_for_storages_invested
unit__user_constraintunits_invested_available_coefficientcoefficient_for_units_invested_available
unit__user_constraintunits_invested_coefficientcoefficient_for_units_invested
unit__user_constraintunits_on_coefficientcoefficient_for_units_on
unit__user_constraintunits_started_up_coefficientcoefficient_for_units_started_up
unit_flow__user_constraintunit_flow_coefficientcoefficient_for_unit_flow
connection__user_constraintconnections_invested_available_coefficientcoefficient_for_connections_invested_available
connection__user_constraintconnections_invested_coefficientcoefficient_for_connections_invested
temporal_blockrepresentative_period_indexrepresentative_block_index
temporal_blockrepresentative_periods_mappingrepresentative_blocks_by_period

2.9 Scaling and unit conversion

node.storage_fom_cost is scaled before renaming from a cost per model duration unit to an annual cost; it is subsequently renamed to storage_fixed_annual_cost. The factor is 365 days expressed in the model's duration unit (hours or minutes). If models use mixed duration units, the script defaults to hourly conversion and logs a warning. Unknown or missing duration units are treated as hours with a warning. The parameter default value is scaled as well as all stored values.

3. Removals

Classes removed

  • unit__commodity
  • unit__node__node (after its listed parameters are migrated)

Parameter removed

  • user_constraint.include_in_non_representative_periods

4. Important migration behaviour and caveats

  • Summation exception: unit.units_unavailable is merged into unit.out_of_service_count_fix using sum; values are summed into the target rather than simply overwriting it.
  • Existing target definitions: for ordinary parameter renames, if the new name already exists, the old definition's attributes/defaults/value list take precedence and old values overwrite same-alternative target values; other target values are retained.
  • Dimension migration copies more than values: parameter definitions, entity records, parameter values, entity alternatives, and entity group memberships are copied/re-mapped. Migrated values overwrite existing values at matching destination keys.
  • Potential database inconsistencies: the script explicitly warns that some older databases may have unit__node__node entities without matching unit__to_node or unit__from_node entities. It recommends fixing those entities manually based on the migration error messages and rerunning.
  • Template list validation: at the end, values are checked against the latest template lists. Values not in a target list may be dropped during list changes, with warnings. Defaults not valid in the new list can also be dropped.
  • Best-effort operations: some class/entity/list operations catch errors and log warnings rather than aborting the entire migration. Review migration logs, especially around class conversion and value-list changes.

5. Summary by migration type

TypeMain changes
Simple renamingParameter names across unit, node, connection, commodity, investment_group, model, multidimensional classes, and temporal_block; commodity → grid; value-list and list-value renames
RestructuringCreate unit_flow superclass and subclasses; reorder flow class dimensions; consolidate flow/investment-group and flow/user-constraint classes; migrate unit__node__node ratio and online-coefficient parameters to unit_flow__unit_flow; consolidate variable-type handling; move node voltage-angle/pressure flags into grid physics
Value transformationConvert storage_fom_cost to annual cost; sum units_unavailable into out_of_service_count_fix; translate node physics booleans into grid physics list values
RemovalRemove unit__commodity, migrated unit__node__node, and user_constraint.include_in_non_representative_periods

Generated from the supplied major_upgrade_1.jl source. This is a documentation of the migration logic declared in that file; it does not claim that every operation succeeds for every database.