Confluence AWS Stack Migration
CNF AWS CloudFormation RDS PostgreSQL Upgrade (?)
CNF AWS CloudFormation RDS PostgreSQL Change Storage Encryption
CNF AWS CloudFormation VPC CIDR Block Update
These steps cover migration of Confluence from one CloudFormation Stack to another. This is useful in the following scenarios...
To upgrade/change the underlying database (i.e. install the new database version as part of a new Stack and import the data from the old Stack into it). Note that the current version of the Stack template (Sep-2020) does not include an option to change the version of PostgreSQL.
To change the CIDR blocks allocated to a VPC. This is useful if you want to set up a VPN and the existing CIDR blocks clash with those in the other network.
This process is the same irrespective of whether the new Stack creates a new VPC in the same account as the original Stack or a new VPC in a different account
Install Confluence Stack
First install the target Confluence Stack being sure to make the necessary parameter changes. If you are creating a new VPC in an existing account you should change the ASI Identifier and the VPC CIDR blocks.
DO NOT CHANGE THE CONFLUENCE VERSION.
Follow the Confluence AWS upgrade instructions as a separate step after the migration is complete if necessary.If you plan to use the same DNS entry to access the new ASI Stack once migration is complete, make sure you enter the same "Existing DNS Name" parameter value (this will cause Confluence to complain until DNS is updated but these warnings should not prevent completion of the steps below.
Configure ssh so that you can easily connect to a Confluence node in the source and target Stacks. Your config file in ~/.ssh should look something like this...
Host 11.11.11.11
ForwardAgent yes
Host 10.10.10.10
ProxyCommand ssh -A ec2-user@11.11.11.11 -W %h:%p
Host 22.22.22.22
ForwardAgent yes
Host 20.20.20.20
ProxyCommand ssh -A ec2-user@22.22.22.22 -W %h:%p
Where 11.11.11.11 is the external IP of the Source Bastion
Where 10.10.10.10 is the internal IP of the Source CNF Node
Where 11.11.11.11 is the external IP of the Source Bastion
Where 22.22.22.22 is the external IP of the Target Bastion
Where 20.20.20.20 is the internal IP of the Target CNF Node
Where 22.22.22.22 is the external IP of the Target Bastion
Backup & Restore Using Confluence Export
Note that this approach is not recommended for large installations. Follow the database backup/restore steps later in this document instead.Backup the Source Database & Attachments
In the source CNF application...
Administration (gear icon) - General Configuration - ADMINISTRATION - Backup & Restore
This will create a zip file in /var/atlassian/application-data/confluence/temp/ on the Confluence node (this is an EFS filesystem so it should be visible from any Jira node)
With your ssh environment setup for the source ASI Stack...
ssh ec2-user@sourceIPaddress
sudo su - root
ls -l
mv /var/atlassian/application-data/confluence/temp/backupfilename.zip /tmp
chown ec2-user /tmp/backupfilename.zip
exit
exit
scp ec2-user@sourceIPaddress:/tmp/backupfilename.zip .
Restore the Target Database & Attachments
scp backupfilename.zip ec2-user@targetIPaddress:/tmp
ssh ec2-user@targetIPaddress
sudo su - root
mkdir -p /media/atl/confluence/shared-home/restore
mv /tmp/backupfilename.zip /media/atl/confluence/shared-home/restore
chown confluence:confluence /media/atl/confluence/shared-home/restore/backupfilename.zip
In the target CNF application...
Administration (gear icon)
General Configuration
ADMINISTRATION
Backup and Restore.
You should see the file you uploaded in the "Import from the home directory" section.
Backup & Restore Using Postgres tools
Note: Follow these steps if your installation is considerd too large for the Confluence Export method shown above.TODO