Set up database for Cloud-hosted migration assistant
As preparation to move your data from your Data Center instance into Atlassian Cloud, you will need to set up your database for migration. Configuring your database helps the Migration connector app receive database change events. Read about Cloud-hosted migration assistant
The Cloud-hosted migration assistant is currently available only to a limited number of customers participating in an early access program. We are not enrolling new customers at this time, but we will keep you updated when we reopen enrollment.
Before you begin
Make sure to have the following information:
Access to your database and database manager
Information on the version of the database your company uses
Follow the instructions based on your database. The steps listed below are similar to replicating your primary database. If you can’t find your database, follow the replication instructions provided by your database vendor to configure your database for migration.
Find instructions for:
Instructions for PostgreSQL
Supported versions: PostgreSQL 11 or later (standalone, RDS, or Aurora)
Setup instructions for standalone PostgreSQL and on RDS
To set up your PostgreSQL database:
Back up your database and postgresql.conf file before making changes.
Enable logical replication. Refer to your database vendor’s documentation for details.
Connect to your database using
psqland check current settings:
show wal_level;
show max_replication_slots;
show max_wal_senders;
SELECT * FROM pg_replication_slots;
SELECT * FROM pg_publication;
SHOW config_file;
- Add the following configurations to the bottom of your postgresql.conf file:
-- Enables logical decoding of WAL for logical replication and change data capture scenarios
wal_level = logical
-- Sets the minimum message severity level that is logged; "warning" logs warnings and above
log_min_messages = warning
-- Sets the maximum number of replication slots for streaming changes to replicas or consumers
max_replication_slots = 10
-- Sets the maximum number of concurrent connections sending WAL data for replication
max_wal_senders = 10
3. Enable Replica Identity as Full for the tables.
DO $$
DECLARE
r RECORD;
BEGIN
FOR r IN
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE'
LOOP
EXECUTE format('ALTER TABLE %I.%I REPLICA IDENTITY FULL', r.table_schema, r.table_name);
END LOOP;
END $$;
4. Restart PostgreSQL to apply changes:
sudo systemctl restart postgresql
5. Create a logical replication user with limited privileges:
psql -h <DB-HOSTNAME> -p <DB-PORT> -U <DB-ADMIN-USER> -d <DB-NAME> -f sql_queries.sql
6. Create a publication by replacing atldb with your Jira database name if different:
-- create replication publication
CREATE PUBLICATION dbz_publication FOR ALL TABLES;
-- create a user for replication role
CREATE USER replication_user WITH PASSWORD 'xxxxx';
-- grant replication permission
ALTER USER replication_user WITH REPLICATION;
-- grant connect to jira database
GRANT CONNECT ON DATABASE atldb TO replication_user;
-- grant read access for all jira tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO replication_user;
-- grant read access for newly created jira tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO replication_user
Setup instructions for standalone PostgreSQL in Aurora
To set up your PostgreSQL database:
Back up your database and postgresql.conf file before making changes.
Enable logical replication:
Connect to your database using
psqland check current settings:
show wal_level;
show max_replication_slots;
show max_wal_senders;
SELECT * FROM pg_replication_slots;
SELECT * FROM pg_publication;
SHOW config_file;
Add the following configurations to the bottom of your postgresql.conf file:
-- Enables logical decoding of WAL for logical replication and change data capture scenarios
wal_level = logical
-- Sets the minimum message severity level that is logged; "warning" logs warnings and above
log_min_messages = warning
-- Sets the maximum number of replication slots for streaming changes to replicas or consumers
max_replication_slots = 10
-- Sets the maximum number of concurrent connections sending WAL data for replication
max_wal_senders = 10
3. Create a new database cluster parameter group and set the following parameters:
-- Enables logical replication features, allowing streaming of data changes for replication or migration purposes
rds.logical_replication = 1
-- Sets the minimum message severity level that is logged; "warning" logs warnings and above
log_min_messages = warning
-- Sets the maximum number of replication slots for streaming changes to replicas or consumers
max_replication_slots = 10
-- Sets the maximum number of concurrent connections sending WAL data for replication
max_wal_senders = 10
4. Enable Replica Identity as Full for the tables.
DO $$
DECLARE
r RECORD;
BEGIN
FOR r IN
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE'
LOOP
EXECUTE format('ALTER TABLE %I.%I REPLICA IDENTITY FULL', r.table_schema, r.table_name);
END LOOP;
END $$;
5. Restart PostgreSQL to apply changes:
sudo systemctl restart postgresql
6. Create a logical replication user with limited privileges:
psql -h <DB-HOSTNAME> -p <DB-PORT> -U <DB-ADMIN-USER> -d <DB-NAME> -f sql_queries.sql
7. Create a publication by replacing atldb with your Jira database name if different:
-- create replication publication
CREATE PUBLICATION dbz_publication FOR ALL TABLES;
-- create a user for replication role
CREATE USER replication_user WITH PASSWORD 'xxxxx';
-- grant replication permission
ALTER USER replication_user WITH REPLICATION;
-- grant connect to jira database
GRANT CONNECT ON DATABASE atldb TO replication_user;
-- grant read access for all jira tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO replication_user;
-- grant read access for newly created jira tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO replication_user
Instructions for MySQL
Supported versions: MySQL 8.0.xx
Setup instructions for MySQL
To set up your MySQL database:
Back up your database before making changes.
Enable replication:
Check current settings:
-- log_bin should be ON which is required for replication
mysql> SHOW VARIABLES LIKE 'log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
+---------------+-------+
-- Expected Value: ROW (required for debezium)
mysql> SHOW VARIABLES LIKE 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+
-- server_id must be set to a non-zero unique number for replication to work.
mysql> SHOW VARIABLES LIKE 'server_id';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| server_id | 12321 |
+---------------+-----------+
mysql> SHOW VARIABLES LIKE 'binlog_row_image';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| binlog_row_image | FULL |
+------------------+-------+
3. Create a custom mysql.conf file in /etc/mysql/ with the following configuration:
[mysqld]
log-bin=mysql-bin
binlog-format=ROW
binlog_row_image=FULL
server-id=1234
If using Docker-based MySQL: Create a custom mysql.conf file in /etc/mysql/ with following configuration:
[mysqld] log-bin=mysql-bin binlog-format=ROW binlog_row_image=FULL server-id=1234
4. Restart MySQL to apply changes.
5. Verify that the setup was done correctly:
SHOW VARIABLES LIKE 'log_bin';
SHOW VARIABLES LIKE 'binlog_format';
SHOW VARIABLES LIKE 'server_id';
SHOW VARIABLES LIKE 'binlog_row_image';
6. Create a replication user:
-- Create Replication User for MySQL
CREATE USER 'replication_user'@'%' IDENTIFIED BY 'xxxxx';
-- Granting permissions
GRANT RELOAD, REPLICATION CLIENT, SELECT, SHOW DATABASES, REPLICATION SLAVE ON *.* TO 'replication_user'@'%';
-- Apply the changes immediately (if needed)
FLUSH PRIVILEGES;
-- view permissions
SHOW GRANTS FOR 'replication_user'@'%';
Setup instructions for MySQL on Amazon RDS
To set up your MySQL database:
Back up your database before making changes.
Enable replication:
Check current settings:
-- log_bin should be ON which is required for replication
mysql> SHOW VARIABLES LIKE 'log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin | ON |
+---------------+-------+
-- Expected Value: ROW (required for debezium)
mysql> SHOW VARIABLES LIKE 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+
-- server_id must be set to a non-zero unique number for replication to work.
mysql> SHOW VARIABLES LIKE 'server_id';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| server_id | 12321 |
+---------------+-----------+
mysql> SHOW VARIABLES LIKE 'binlog_row_image';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| binlog_row_image | FULL |
+------------------+-------+
3. Enable automated backups for your database instance to enable binary logging.
If the database instance is not configured to perform automated backups, the binlog will be disabled, even if you apply the settings described in the previous steps.
Go to AWS console and search for “your-mysql-database-name” under RDS.
Enable automated backup required for binary logging.
Edit database parameter group and set (check if they are already enabled):
binlog-format=ROW
binlog_row_image=FULL
server-id=1234
4. Restart MySQL to apply changes.
5. Verify that the setup was done correctly:
SHOW VARIABLES LIKE 'log_bin';
SHOW VARIABLES LIKE 'binlog_format';
SHOW VARIABLES LIKE 'server_id';
SHOW VARIABLES LIKE 'binlog_row_image';
6. Create a replication user:
-- Create Replication User for MySQL
CREATE USER 'replication_user'@'%' IDENTIFIED BY 'xxxxx';
-- Granting permissions
GRANT RELOAD, REPLICATION CLIENT, SELECT, SHOW DATABASES, REPLICATION SLAVE ON *.* TO 'replication_user'@'%';
-- Apply the changes immediately (if needed)
FLUSH PRIVILEGES;
-- view permissions
SHOW GRANTS FOR 'replication_user'@'%';
Instructions for MS SQL Server
Supported versions: 2017, 2019, 2022
Setup instructions for MS SQL Server
To set up your MS SQL Server database:
Back up your database before making changes.
Check if Change Data Capture (CDC) is enabled:
-- <database> - database name on which replication needs to be run. Default: atldb
SELECT name, is_cdc_enabled FROM sys.databases WHERE name = '<database>';
-- <atldb_table> - a table name on which replication needs to be run. Default: cwd_user
SELECT name, is_tracked_by_cdc FROM sys.tables WHERE name = '<atldb_table>';
3. If CDC is not enabled, using the following script to enable it. Note: Only a user with admin permissions can perform this action.
4. Save the above script in to enable-cdc.sql and execute it using following command
sqlcmd -S <dbhost> -U <dbuser> -P '<dbpassword>' -d <dbname> -i enable-cdc.sql
5. Validate CDC is now enabled as per step 2.
6. Create a CDC user:
-- Create a SQL Server login
CREATE LOGIN replication_login WITH PASSWORD = 'StrongPassword123!';
-- Switch to your source database
USE atldb;
-- Create a user tied to the login
CREATE USER replication_user FOR LOGIN replication_login;
GRANT required permission
-- grant membership in db_datareader role
ALTER ROLE db_datareader ADD MEMBER replication_user;
-- grant access for debezium to access tables and CDC metadata
GRANT EXECUTE ON SCHEMA::cdc TO replication_user;
GRANT SELECT ON SCHEMA::cdc TO debezium_user;
Setup instructions for MS SQL Server on Amazon RDS
To set up your MS SQL Server database:
Back up your database before making changes.
Check if Change Data Capture (CDC) is enabled:
-- <database> - database name on which replication needs to be run. Default: atldb SELECT name, is_cdc_enabled FROM sys.databases WHERE name = '<database>'; -- <atldb_table> - a table name on which replication needs to be run. Default: cwd_user SELECT name, is_tracked_by_cdc FROM sys.tables WHERE name = '<atldb_table>';
3. If CDC is not enabled, enable CDC using the following script. Note: Only users with admin permissions can perform this action.
4. Save the above script in to enable-cdc-rds.sql and execute it using following command
sqlcmd -S <dbhost> -U <dbuser> -P '<dbpassword>' -d <dbname> -i enable-cdc-rds.sql
5. Validate CDC is now enabled as per step 2.
6. Create a CDC user:
-- Create a SQL Server login
CREATE LOGIN replication_login WITH PASSWORD = 'StrongPassword123!';
-- Switch to your source database
USE atldb;
-- Create a user tied to the login
CREATE USER replication_user FOR LOGIN replication_login;
GRANT required permission
-- grant membership in db_datareader role
ALTER ROLE db_datareader ADD MEMBER replication_user;
-- grant access for debezium to access tables and CDC metadata
GRANT EXECUTE ON SCHEMA::cdc TO replication_user;
GRANT SELECT ON SCHEMA::cdc TO debezium_user;
Instructions for Oracle
Supported versions: 12 and 19
Setup instructions for Oracle
To set up your Oracle database:
Back up your database before making changes.
SSH into the database host and set the the environment variable ORACLE_SID.
# verify if ORACLE_SID is set
echo $ORACLE_SID
If ORACLE_SID is blank, set it using the following bash command:
# set the ORACLE_SID if it is not set
if [ -z "$ORACLE_SID" ]; then
export ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`"
fi
The next steps require a root user to enable logminer config for CDC
3. Enable backups for Oracle database.
To confirm that Oracle has backups enabled, execute the following command:
SELECT LOG_MODE FROM V$DATABASE;
The LOG_MODE should say ARCHIVELOG. This means that backups are enabled and we can skip to next step.
LOG_MODE
------------
ARCHIVELOG
Execute the following script to enable backups in Docker. This will enable backups and reboot the database in the process.
4. Enable supplemental logging by running the following script:
sqlplus / as sysdba <<- EOF
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
exit;
EOF
5. Set the open_cursors parameter by running the following script:
sqlplus / as sysdba <<- EOF
ALTER SYSTEM SET open_cursors = 10000 SCOPE=BOTH;
exit;
EOF
6. Check open_cursors parameter value by running the following script. The output should be 10000.
SHOW PARAMETER open_cursors;
7. Set the UNDO_RETENTION parameter to 86400(1 Day) since snapshots can longer than 15 minutes or the configure the parameter to perform the initial snapshot and eventually lead to this exception:
ORA-01555: snapshot too old: rollback segment number 12345 with name "_SYSSMU11_1234567890$" too small
8. Run this script as you’re using Docker:
sqlplus / as sysdba <<- EOF
ALTER SYSTEM SET UNDO_RETENTION = 86400 SCOPE=BOTH;
exit;
EOF
9. Check the UNDO_RETENTION parameter value by running the following script. The output should be 86400.
SHOW PARAMETER UNDO_RETENTION;
10. Create a replication user.
Oracle introduced Multitenant architecture in Oracle DB 12c and made it mandatory from 21c. The steps to create a replication user vary depending on the db architecture used.
If you’re using Oracle with multi-tenant architecture (The following steps will require a DBA user with sysdba privileges to create a replication user):
- Create a logminer tablespace in CDB
Replace placeholders <oracle_sid> before executing
sqlplus / as sysdba <<- EOF
CREATE TABLESPACE LOGMINER_TBS DATAFILE '/opt/oracle/oradata/<oracle_sid>/logminer_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
exit;
EOF
- Create a logminer tablespace in pluggable databases (PDBs). This is usually 'jiradb' or 'atldb'.
- Check available PDBs using below command:
sqlplus <dba_user>/<dba_user_pwd>@<db_host>:<db_port>/<oracle_sid> as sysdba <<- EOF
select name from v\$pdbs;
exit;
EOF
- You should receive the following output:
NAME
------------------------------------------------------------------------
PDB$SEED
ATLDB
- Create tablespace for PDBs from above output except PDB$SEED, ORCLCDB (CDB) using the following command:
Replace placeholders <oracle_sid>,<pdb_name>
sqlplus <dba_user>/<dba_user_pwd>@<db_host>:<db_port>/<pdb_name> as sysdba <<- EOF
CREATE TABLESPACE LOGMINER_TBS DATAFILE '/opt/oracle/oradata/<oracle_sid>/logminer_tbs_<pdb_name>.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
exit;
EOF
- Create a replication user and grant required access on CDB.
- For a multi-tenant architecture the username should start with the prefix 'c##' (mandatory). eg - c##replication_user
Replace placeholders <replication_user>, <replication_user_pwd>
- Grant access on Jira PDB (this will usually be JIRADB or ATLDB
The Jira PDB can also be validated from the Database URL in System Info by logging into Jira.
If using Oracle with Non Multi-Tenant Architecture:
- Create tablespace for Jira DB
- The Jira DB name can be validated from the Database URL in System Info by logging into Jira.
Replace placeholders <dba_user>, <dba_user_pwd>, <db_host>, <db_port>,<db_name>
sqlplus <dba_user>/<dba_user_pwd>@<db_host>:<db_port>/<db_name> as sysdba <<- EOF
CREATE TABLESPACE LOGMINER_TBS DATAFILE SIZE 25M AUTOEXTEND ON MAXSIZE UNLIMITED;
exit;
EOF
- Create a replication user and grant required access.
- For non multi-tenant architecture a local user should be created without the prefix 'c##'. eg - replication_user
Replace placeholders <dba_user>, <dba_user_pwd>, <db_host>, <db_port>, <db_name>, <replication_user>, <replication_user_pwd>
Setup instructions for Oracle on RDS
To set up your Oracle database:
Back up your database before making changes.
SSH into the database host and set the the environment variable ORACLE_SID
# verify if ORACLE_SID is set echo $ORACLE_SIDIf ORACLE_SID is blank, set it using the following bash command:
# set the ORACLE_SID if it is not set if [ -z "$ORACLE_SID" ]; then export ORACLE_SID="`grep $ORACLE_HOME /etc/oratab | cut -d: -f1`" fiThe next steps require a root user to enable logminer config for CDC
3. Enable backups for Oracle database - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.backups.html
To confirm that Oracle has backups enabled, execute the following command:
SELECT LOG_MODE FROM V$DATABASE;The LOG_MODE should say ARCHIVELOG. This means that backups are enabled and we can skip to next step.
LOG_MODE ------------ ARCHIVELOG
Enable backups for Oracle DB. Set the backup retention period to 1 day.
Set the database to retain archive logs for 24 hours.
exec rdsadmin.rdsadmin_util.set_configuration('archivelog retention hours', 24);
4. Enable supplemental logging. Run the following script:
exec rdsadmin.rdsadmin_util.alter_supplemental_logging('ADD');
5. Set the open_cursors parameter - https://repost.aws/knowledge-center/rds-modify-parameter-group-values
Update the open_cursors parameter to 10000 for the DB.
6. Check open_cursors parameter value.
SHOW PARAMETER open_cursors;
7. Set the UNDO_RETENTION parameter to 86400(1 Day) since snapshots can longer than 15 minutes or configure the parameter to perform the initial snapshot and eventually lead to this exception:
ORA-01555: snapshot too old: rollback segment number 12345 with name "_SYSSMU11_1234567890$" too small
Update the undo_retention parameter to 86400 for the DB.
8. Check UNDO_RETENTION parameter value. The output should be 86400.
SHOW PARAMETER UNDO_RETENTION;
9. Create a tablespace for Jira database. The database name can be validated from the Database URL in System Info by logging into Jira.
Replace placeholders <dba_user>, <dba_user_pwd>, <db_host>, <db_port>,<db_name>
sqlplus <dba_user>/<dba_user_pwd>@<db_host>:<db_port>/<db_name> <<- EOF
CREATE TABLESPACE LOGMINER_TBS DATAFILE SIZE 25M AUTOEXTEND ON MAXSIZE UNLIMITED;
exit;
EOF
10. Create a replication user and grant required access.
Replace placeholders <dba_user>, <dba_user_pwd>, <db_host>, <db_port>, <db_name>, <replication_user>, <replication_user_pwd>