---
title: Update from older versions of the Python SDK
slug: feature-experimentation/docs/migrate-from-older-versions-python
docTags: 
createdAt: 2026-08-05T20:39:54.000Z
---

This section provides code examples for how You should leveraging the new [Decision](docId\:i0YJZkiaylg7J6QKk3GR_) and [Event Tracking](docId:_Z3MmQTkwUR-QgKN8kuMf) APIs. All existing [Full Stack (Legacy)](docId:6_ik6SSz-WyJLWuCQw7BT) methods and implementation are still supported. See [Optimizely Feature Experimentation - application & migration](docId\:bykQnE4aGRkC5WXhU6Yi5) documentation for the latest updates.

You should adopting the new `Decide`, `Decide All`, and `Track Event` methods as a more flexible and easier-to-use replacement where you currently use `isFeatureEnabled`, `getFeatureVariable`, `getAllFeatures`, or `Track` calls within your implementation.

The following are examples of how to migrate the Full Stack (Legacy) methods to Feature Experimentation methods:

```python
from optimizely import optimizely
from optimizely.decision.optimizely_decide_option import OptimizelyDecideOption

# -------------------------------
# Prereq for new methods: create a user
# ------------------------------
attributes = {"is_logged_in": True}
user = optimizely_client.create_user_context("user_123", attributes)

# -------------------------------
# Is Feature Enabled
# ------------------------------
# old method
enabled = optimizely_client.is_feature_enabled("flag_1","user_123", attributes)

# new method
decision = user.decide("flag_1")
enabled = decision.enabled

# -------------------------------
# Activate & Get Variation
# ------------------------------
# old method
variation_key = optimizely.activate('experiment_key', 'user_123', attributes)

# new method
variation_key = decision.variation_key


# -------------------------------
# Get All Feature Variables
# ------------------------------
# old method
all_var_values = optimizely.get_all_feature_variables('my_feature_key', 'user_123', attributes)
                                                           
# new method
all_var_values = decision.variables


# -------------------------------
# Get Enabled Features
# ------------------------------
# old method
enabled_features = optimizely.get_enabled_features("user_123")

# new method
decisions = user.decide_all([OptimizelyDecideOption.ENABLED_FLAGS_ONLY])
enabled_flags = decisions.keys


# -------------------------------
# Track
# ------------------------------
# old method
optimizely.track('my_purchase_event_key', 'user_123', attributes, {"purchase_count": 2})

# new method
user.track_event('my_purchase_event_key', {"purchase_count": 2})
```
