---
title: "Switching SitecoreAI environments for testing purposes"
slug: "switching-sitecoreai-environments-for-testing-purposes"
abstract: "Understand how to switch SitecoreAI environments during development for testing purposes."
---
# Switching SitecoreAI environments for testing purposes

During development, you might need to switch between different SitecoreAI environments. For example, you might test your app in your organization's non-production environment before deploying a change to production. Or you might have a demo environment to occasionally switch to.

To switch SitecoreAI environments during development:

1. In the Sitecore Cloud Portal, find and copy [the Context ID](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/context-ids.html) for the environment you want to switch to.
2. In your application code, update the Context ID value with the value you copied in the previous step. This value is typically stored in your environment variables file.
3. In your web browser, navigate to the app you're developing, typically at `http://localhost:3000`, and then delete the `sc_cid` and `sc_cid_personalize` cookies.
4. Restart your development server, and then navigate to the app you're developing again.

    Your app now sets new values for the `sc_cid` and `sc_cid_personalize` cookies, linked to the new Context ID you added to your application code in a previous step. This means that you've successfully switched SitecoreAI environments in your development environment.