Migrating a deployment
Asked by Riya Sen:

Hi, I want to migrating a deployment to a different S3 bucket?


Answers:
author: Soumyadeep Mandal
body: Hi [@Riya Sen](/t5/user/viewprofilepage/user-id/3876540) ,

Welcome to the community!

Your deployment needs to be based on templates stored on your own S3 bucket. This will quarantine your deployment from unexpected changes to the AWS Quick Starts.

### ****Option 1: Re-deploy from templates in your own S3 bucket (for nested database stacks)**** {#toc-hId-1175783539}

We introduced nested stacks to the AWS Quick Start for Confluence on 12 Jun 2019 . If you used the AWS Quick Start after this date, then your deployment uses nested database stacks.

If this is the case, then you'll have to re-deploy from scratch. When you do, you'll need to use templates from your own S3 bucket. See [Deploying the Quick Start from your own S3 bucket (recommended)](https://confluence.atlassian.com/doc/running-confluence-data-center-in-aws-879956085.html) for instructions .

### ****Option 2: Re-base your existing deployment on separate templates (for non-nested database stacks)**** {#toc-hId--631670924}

If your deployment doesn't use nested stacks, then you can re-base your deployment to new templates from a different S3 bucket. This involves the following steps:

Create your own S3 bucket.

Download the templates used by your deployment.

Recreate the original AWS Quick Start's directory structure on your S3 bucket.

Update your deployment to use the templates from your bucket.

The following procedure will involve the use of the [AWS Command Line Interface](https://aws.amazon.com/cli/). This tool will allow you to create an S3 bucket and upload content to it. Refer to Amazon's [instructions on setting it up](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html).

You can also perform these steps through the [AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/what-is-s3.html).

#### ****Step 1: Create your own S3 bucket**** {#toc-hId-58890550}

If you don't have one already, you can create an S3 bucket in your region via the AWS CLI:

aws s3 mb s3://\<bucket-name\> --region \<AWS_REGION\>

Alternatively, you can also [create an S3 bucket through the AWS Management Console](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).

#### ****Step 2: Download the templates used by your deployment**** {#toc-hId--1748563913}

AWS Quick Start deployments are typically composed of two stacks: the Atlassian Standard Infrastructure (ASI) and your product stack (in this case, Confluence Data Center).

In the AWS Management Console, go to ****CloudFormation \> Stacks****.

Find the ****Stack Name**** of both stacks -- both won't have the ****NESTED**** tag on them.

Download their templates via the AWS CLI:

aws cloudformation get-template --stack-name \<StackName\> --region \<AWS_REGION\>

Refer to [Retrieving a Template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-get-template.html) for more details.

#### ****Step 3: Recreate the original AWS Quick Start's directory structure on your S3 bucket**** {#toc-hId-738948920}

Now that you've downloaded the templates you need, edit and upload them to your new S3 bucket:

In the templates you downloaded, the QSS3BucketName default value is set to aws-quickstart. Replace this default with the name of the bucket you created earlier.

Recreate the original AWS Quick Start on your S3 bucket. Do this by copying the original Quick Start's directory structure and uploading the ASI and product stack templates accordingly:

quickstart-atlassian-confluence

?? submodules

? ?? quickstart-atlassian-services

? ?? templates

? ??? \<ASI stack template\>

?? templates

??? \<Product stack template\>

Set the templates to be Public. This will allow your stack to access them later.

Refer to the following pages for more details:

[++Uploading S3 Objects++](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/upload-objects.html)

[++Creating a Folder++](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-folder.html)

[Making Folders Public](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/public-folders.html)

#### ****Step 4: Update your deployment to use the templates from your bucket**** {#toc-hId--1068505543}

We strongly recommend you test this in a staging environment before updating your production deployment.

Open the ****Stack Details**** of your deployment's primary stack. This is the stack without the ****NESTED**** tag on it.

Click the ****Update Stack**** button.

In the ****Specify an Amazon S3 template URL**** field, paste in the Object URL of the Quick Start template you'll be using. Click ****Next****.

In the next screen, go to the ****AWS Quick Start configuration**** section. Verify that the ****Quick Start S3 Bucket Name**** field matches the S3 bucket you created earlier.

Click ****Next****. This will update your deployment to now point to your clone of the Quick Start templates.

comments: author: Riya Sen
body: Thank you so much for your quick \& detailed answer.


Tags: atlassian-sdk

aws

cloud

confluence-cloud