# Migration guide to v3.1.0 or newer

## Migrating from TyrAds SDK v3.0 (.unitypackage) to v3.1.0 or newer (UPM)

This guide walks you through upgrading a project that previously used the v3.0 .unitypackage to the new v3.1.0 or newer package distributed via the Unity Package Manager (UPM).

Before you start

* Commit or back up your project.
* Close running play sessions and save all open scenes.

***

### 1) Remove the old v3.0 installation

The .unitypackage installed files directly under your Assets/ folder. To avoid duplicate symbols and GUID conflicts, remove the old content completely.

Default folder path:

```
Assets/Plugins/TyrAdsSDK/. //Path could be if differ if your team have moved sdk
```

***

### 2) Install latests (v3.1.0 or newer) package via the Unity Package Manager (UPM)

Follow the steps from [Installation](https://sdk-doc.tyrads.com/unity/installation) page.

After installation, you should see TyrAds Unity SDK under Packages/ in the Project window.

***

### 3) Verify & refresh scene references

Because the UPM package provides new prefab and script GUIDs, references from the old .unitypackage may be missing. Open your main scenes and fix any missing references.

#### 3.1 Main SDK object on the scene

* Look for your previous TyrSDKPlugin object.
* If the component shows Missing (Mono Script) or a broken reference:
  1. Remove the broken component/prefab instance.
  2. Locate the new prefab in the package folder

     <kbd>Packages/com.tyrads.unity-sdk/Runtime/Prefabs/TyrSDKPlugin.prefab</kbd>.
  3. Drag the new prefab into your scene.
  4. Reapply any scene-specific settings you previously had.

#### 3.2 Premium widget prefab

* Find any UI locations where the premium widget was used.
* If you see a Missing (Prefab) or Missing (Mono Script):
  1. Remove the broken reference.
  2. Locate the new prefab in the package folder

     <kbd>Packages/com.tyrads.unity/Runtime/Prefabs/PremiumWidget/PremiumWidget.prefab</kbd> .
  3. Drag the new premium widget prefab into your scene.
  4. Reconnect it to your UI hierarchy and set its properties as needed.

***

### 4) Reapply configuration (only if you used the SDK editor window)

* If you previously configured the SDK via its Editor Window (e.g., entering app ids/keys, toggles, or project-wide settings):
  * Open the new TyrAds Settings&#x20;

    **TyrSDK > TyrSDK Settings**.
  * Re-enter your configuration values as before.
* If your configuration is set programmatically (in code):
  * No extra steps needed. Your code-based configuration should continue to work after you fix script/component references.

***

### 5) Clean up and validate

1. Save all modified scenes.
2. Enter Play Mode and validate:
   * Initialization logs appear without errors.
   * The premium widget renders and behaves as expected.
   * Ads/placements load and show as before (in appropriate test/dev environments).

***

### Troubleshooting

* Duplicate class/namespace or redefinition errors:

  You still have old .cs files under Assets/. Recheck step 1 and remove any leftovers.
* Missing script on a prefab after install:

  Replace the instance with the new prefab from the UPM package (see step 3).
* Editor window/menu not found:

  Ensure v3.1.0 or newer is installed under Packages/ and re-open Unity if needed. Some editor menus appear after a domain reload.

***

### Quick Checklist

* Old TyrAds folders removed from Assets/ (default or any custom locations)
* TyrAds SDK v3.1.0 or newer installed via UPM
* Main SDK scene object replaced/verified
* Premium widget prefab replaced/verified
* Configurations re-applied (only if previously set in editor)
* Play Mode sanity test passed
