Skip to main content

Migrating Between Lens Studio Versions

How to upgrade a Lens Studio 5 project to a newer Lens Studio version: what the update dialog does, how to update packages and deprecated APIs, and how an agent can help.

This guide covers opening a project saved by an older Lens Studio 5 version in a newer version, and what to check after the upgrade. Projects from Lens Studio 4 and earlier use a different file format; see Upgrading from Lens Studio 4.

Before You Upgrade

  • Put the project under source control: commit the project before opening it in the new version, so you can compare the upgraded files and go back if something breaks. See Working with Git.
  • Note the current version: the project's .esproj file records the Lens Studio version that last saved it in its studioVersion field.
  • Read what changed: check the Lens Studio Release Notes for every version between the old one and the new one, and the release notes of the packages the project uses.
  • Check the minimum app versions: each Lens Studio version sets the oldest app version that can run the Lenses it publishes, and a newer Lens Studio usually raises that version. After the upgrade, people on an older app version can't use the Lens.
    • Snapchat: the About Lens Studio dialog shows the minimum Snapchat version as Min. Mobile Client.
    • SPECS: Lens Studio checks the software version of the connected SPECS; see Check the SPECS software version.
    • Camera Kit: the Lens Scheduler shows the minimum Camera Kit SDK version for each Lens; see All Lenses.
  • Keep the older Lens Studio installed: the older version is the easiest way to check how the Lens behaved before the upgrade.

Open the Project in the New Version

When a project needs an update, Lens Studio shows the dialog Project needs to be updated to open with current version of Lens Studio. The dialog shows the old and new versions, and how many of the project's packages, or which ones, it will update to the new format. When only packages need the update, the dialog's title is Project is already up to date with current version of Lens Studio. instead, and the dialog lists the packages. Either way, the dialog has three buttons:

ButtonWhat happens
Update and OpenLens Studio updates the project in place. Before the update, Lens Studio saves the .esproj file and the Assets and Packages folders as a zip file named after the old version, in the project's BackUp folder.
Duplicate and OpenLens Studio asks for a new folder, copies the project there and updates the copy. The copied .esproj file is renamed after the new folder. The original project stays unchanged.
CancelLens Studio doesn't open the project.

The update is one-way. An older Lens Studio still opens the updated project, but it shows a warning and the project may not work correctly there. Choose Duplicate and Open if you still need to work on the project in the older version.

Lens Studio adds the BackUp folder to the project's .gitignore file, so the backup zip stays out of source control. Keep the commit from "Before You Upgrade" as the copy you can return to.

A project with no pending update steps opens without the dialog, and Lens Studio makes no backup. Saving the project still records the new Lens Studio version in the .esproj file, so after a save the older version shows the warning described below. To keep a copy for the older version, commit or duplicate the project folder before saving.

Opening a Project in an Older Version

Lens Studio doesn't block opening a project saved by a newer version. An older Lens Studio shows the Project Version Warning dialog: "This project was created with a newer version of Lens Studio. Project may be unstable." Yes opens the project anyway, and the project may not work correctly. No doesn't open the project, so you can open it in the newer version instead. Importing a package created in a newer version shows a similar warning, because the import may corrupt the project.

Update Packages

The project update brings packages to the new project format, but the update doesn't install newer versions of Asset Library packages, such as Interaction Kit and UI Kit. Lens Studio marks a package that has a newer version with an Update Available badge in the Asset Browser panel.

  • Update to the latest version: select Update on the package in the Asset Library panel, or right-click the package in the Asset Browser panel and choose Pull Update from Library.
  • Install a specific version: in the Asset Library panel, open the package's … menu and choose Install Another Version. The menu item appears when other versions of the package exist.

Read the package's release notes before updating, because a new package version can rename or remove the components and APIs that your scripts use. See the release notes for Interaction Kit, UI Kit and Sync Kit. For Interaction Kit, see also Update Interaction Kit in a project. For packages from an installed library, see Package Library Management.

Fix Deprecated APIs and Script Errors

Starting from Lens Studio 5.8.0, Lens Studio warns when a Lens uses a deprecated API, Component or asset type. The warnings appear in the Logger panel with a [Deprecated] tag. A later Lens Studio version will turn the warnings into errors and block publishing, so replace each deprecated API. Deprecated Lens Scripting APIs lists deprecated APIs, but the list doesn't cover every change, so the agent-assisted upgrade below is the most thorough way to find and replace them.

TypeScript errors also appear in the Logger panel: TypeScript compilation failed! is followed by one line for each compiler error. Fix the errors before testing the Lens.

Agent-Assisted Upgrades

A coding agent with CLAD can do much of an upgrade through the Lens Studio MCP server, including replacing deprecated APIs and fixing the script errors from the previous step. To set up the agent, follow the CLAD setup guide for Claude Code, Codex or Cursor. Commit the project before the agent starts, so you can review each change the agent makes.

  • Ask for the upgrade: ask the agent to read the Logger panel, replace every deprecated API with its replacement, and fix every script error.
  • Update packages: the update-lens-packages skill updates the installed packages, such as Interaction Kit, UI Kit and Sync Kit, to their latest versions or to a version you name.
  • Move a Spectacles (2024) project to SPECS 27: the specs-27-migration skill first updates the project to the current Lens Studio version in place, then replaces Spectacles (2024)-era APIs with their SPECS 27 replacements. See Migrating a Lens to SPECS 27.

Test the Upgraded Lens

  1. Check the Logger panel: clear every error and deprecation warning.
  2. Compare with the older version: open the original project, from the commit or the Duplicate and Open source folder, in the older Lens Studio. Run the Lens in the Preview panel of both versions and check that the Lens looks and behaves the same. Compare against the original project rather than the upgraded one, because the older version may not run the upgraded project correctly.
  3. Test on a device: push the Lens to Snapchat or to SPECS and test every interaction.
  4. Commit the upgraded project: commit the updated .esproj file and assets together, so the upgrade is one change in the project history.

Upgrading from Lens Studio 4

Lens Studio 5 can't open projects from Lens Studio 4 and earlier, which are saved as .lsproj files. To move content from Lens Studio 4, export it from Lens Studio 4 and import it into a Lens Studio 5 project. See Migrating to Lens Studio 5.