---
title: Deploy an existing Commerce Connect site
slug: dxp/docs/deploying-an-existing-commerce-site
docTags: 
createdAt: 2026-07-30T20:33:07.587Z
---

## When is this applicable?

This is an onboarding scenario for an **existing site which you want to move to a cloud-based environment for the first time**, for further development and maintenance there. In this case you already have a database with content, and you will need to get that restored to the correct application, which will be done by Optimizely.

## Before you start

This topic uses Visual Studio with the Optimizely extensions and publish profiles. However, you can also use [other deployment methods](https://docs.developers.optimizely.com/digital-experience-platform/docs/deploying).

- See [DXP requirements](https://docs.developers.optimizely.com/digital-experience-platform/docs/requirements) for recommended software versions, tools, and services when deploying.
- See [Get started with DXP](https://docs.developers.optimizely.com/digital-experience-platform/docs/getting-started-with-dxp) for deployment information.

:::hint{type="warning"}
**Important**

If not already done, remember to **change the default login credentials** (admin/store) provided in the Commerce Connect installation, before deploying.
:::

## Output and file formats

To deploy from your local development environment, you must create a set of output files and provide these to Optimizely for deployment to the Integration environment.

A Commerce Connect solution comprises two databases: one for CMS and one for Commerce Connect. So, there are additional output components compared to a plain CMS site.

## Create the output files

To deploy from your local development environment, export the database as a **.bacpac** file and upload it to the DXP integration environment's storage account. [Optimizely Support](https://support.optimizely.com/hc/en-us) will import it for you.

You can also upload the BLOBs directly (unpacked) to your DXP integration environment's storage account.

Also, you can deploy the code using the deployment API to the DXP integration environment.

### Step 1 – Create a code package

1. Add a cloud platform to the website. In the NuGet package manager:
   1. Select **Browse**.
   2. Enter **cloud** in the search field.
   3. Select the `EPiServer.CloudPlatform.Commerce` package.
   4. Select your project.
   5. Click **Install** and confirm the installation.
   6. Repeat steps 1 to 5 to install `EpiServer.CloudPlatform.Cms` package.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/uuPdaKwKkb5ZkPdKWA7u4-20260722-203652.png)

2. To configure the `EPiServer.CloudPlatform.Cms` package, you need to add this code in `ConfigureServices` method in `startup.cs` file.

```csharp
public class Startup 
{ 
    private readonly IWebHostEnvironment _webHostingEnvironment; 
    private readonly IConfiguration _configuration; 

    public Startup(IWebHostEnvironment webHostingEnvironment, IConfiguration configuration) { 
        _webHostingEnvironment = webHostingEnvironment; 
        _configuration = configuration; 
    } 

    public void ConfigureServices(IServiceCollection services){ 
       ... 
       services.AddCmsCloudPlatformSupport(_configuration); 
       services.AddCommerceCloudPlatformSupport(_configuration); 
    } 
}
```

:::hint{type="info"}
**Note**

If you only want to add the `EPiServer.CloudPlatform.Cms` package to specific environments, you can run something similar to the following code to check the environment.
:::

```csharp
public class Startup 
{ 
    private readonly IWebHostEnvironment _webHostingEnvironment; 
    private readonly IConfiguration _configuration; 

    public Startup(IWebHostEnvironment webHostingEnvironment, IConfiguration configuration) { 
        _webHostingEnvironment = webHostingEnvironment; 
        _configuration = configuration; 
    } 

    public void ConfigureServices(IServiceCollection services){ 
       ...        
        if (!_webHostingEnvironment.IsDevelopment()) { 
           services.AddCmsCloudPlatformSupport(_configuration);
           services.AddCommerceCloudPlatformSupport(_configuration); 
        } 
    } 
}
```

3. Run the solution.

### Step 2 – Publish the website to create a code package

1. Right-click the project in Visual Studio's Solution Explorer and select **Publish**.
2. In the **Pick a publish target** dialog box, select **New Folder**.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/QlqNRENhgcHvUa00NBe8h-20260722-203652.png)

3. Click **Next**.
4. Choose a location or keep the default.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Xvhi1mk2XDVEQWaJ9CTgc-20260722-203652.png)

5. Click **Finish**.
6. Zip the contents of the publish directory and rename it to `ProjectName.cms.app.00001.nupkg`.

### Step 3 – Deploy package

Get API credentials. If you need to know how to do that, click [Deployment API authentication](https://docs.developers.optimizely.com/digital-experience-platform/docs/authentication). The sample to deploy the code is using PowerShell. Any deployment API method will work as long as you deploy a package.

```powershell
# Connect EpiCloud using credentials from portal
Connect-EpiCloud -ProjectId "projectId" -ClientKey "key" -ClientSecret "secret"

# Upload .NET Core Alloy to blob storage
$sasUrl = Get-EpiDeploymentPackageLocation
Add-EpiDeploymentPackage -SasUrl $sasUrl -Path .\AlloyNetCore.cms.app.0.1.0.nupkg

# Deploy package to environment. This will first build a docker image out of the package and then deploy it to the target environment.
Start-EpiDeployment -DeploymentPackage "AlloyNetCore.cms.app.0.1.0.nupkg" -TargetEnvironment "Integration" -DirectDeploy -Wait
```

### Step 4 – Connect the database

In Microsoft SQL Server Studio, repeat steps 1-4 below for the **front-end site database** and for the **back-end Commerce Manager database** to create the `bacpac` output files.

1. Connect to the database to use.
2. Right-click on the database, and select **Tasks** > **Export Data-tier Application...**

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/9uivm4I10JyhaCW3BQzI3_d4c9bbe-09.jpg)

3. In **Export Settings:**
   1. Select **Save to local disk**.
   2. Select a target location for the files.
   3. Enter a name for the `bacpac` file.
   4. Click **Next**.

![Export settings](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/LZYwChHUFv8QR8iskjwpW-20260722-203652.jpg "dxc10.jpg")

4. After the export, verify the results and click **Close**.

![verify the results](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/jj46VO4T0YSdrDy05QIDX-20260722-203652.jpg "11.jpg")

### Media/BLOB

For the **front-end site**, use the following steps to create the output file for the media/BLOB content.

1. In Visual Studio, right-click on your project and select **Open folder in File Explorer**.
2. Locate the `blobs` folder under `App_Data`, and zip the content of the `blobs` folder using a zip tool of your choice.

![Locate the blobs folder](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/jH274JLtMQAPQ8fWKBuAe-20260722-203652.png "dxcblobs.png")

## Upload the output files

When you have created the output files, contact [Optimizely](mailto\:managedservices@Optimizely.com) and follow the instructions provided to upload them to the assigned area. Optimizely will then finalize the deployment.
