# Migrating from v2

Batch Web SDK v3 is a major release, which introduces breaking changes from 2.x. This guide describes how to update the script in a website already using a previous version.

### Upgrading the SDK version

To upgrade from v2 to v3, you need to change the SDK version in two places:

* On your page script or tag manager, replace `https://via.batch.com/v2/bootstrap.min.js` with `https://via.batch.com/v3/bootstrap.min.js`.
* Download the new [SDK files](https://download.batch.com/sdk/web/BatchSDK-web-3.5.0.zip) and update your service worker implementation
  * If you're using `batchsdk-worker-loader.js`, simply replace this file with the new one.
  * If you added Batch in your custom service worker implementation, set `BATCHSDK_MAJOR_VERSION`'s value to `3`.

### Safari support

Support for Safari push notifications has been introduced and requires additional configuration. See our [Safari documentation for more info](/developer/sdk/web/getting-started/safari-setup.md).

### Removal of insecure HTTP/Multidomain mode

This SDK version has removed support for the [HTTP/Multidomain mode](/developer/sdk/web/legacy-documentation/unsecure-mode.md): HTTPS is now required to use the SDK and origins are isolated as expected by web standards.

As migrating from the multidomain mode has implications developers need to be aware of, the SDK will **refuse** to start if `sameOrigin: true` is set in the configuration. Remove it once you want to start your migration.

{% hint style="info" %}
Note: Migrating a website from the HTTP/Multidomain mode should be done with care. Please reach out to our team before upgrading so we can discuss your specific goals and advise you on this topic.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/developer/sdk/web/advanced/2x-migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
