How to migrate FOD database to AWS RDS

Overview

A prepackaged Aspera Faspex On Demand (FOD) instance runs Faspex MySQL database on local host.  However, you can run Faspex MySQL database on a remote host such as a RDS instance.  This article provides instructions on how to migrate your current Faspex database to a AWS RDS instance and use RDS to host Faspex database.   

 

Prerequisites

This article assumes the following:

  • You have purchased and booted up Aspera Faspex On Demand v.3.5.6 or higher
  • You can SSH as root to your Aspera On Demand Instance
  • You have user permissions to create RDS instances and security groups.
  • You know how to create RDS instances.

 

Procedure

1) Create RDS instance with MySQL 5.5.42 or earlier

Make sure that security group(s) are setup to allow your FOD instance to connect to your RDS instance.  Please note the following:

  • The default port for MySQL in RDS is set to TCP/3306 (you will need this later).
  • You need to create a security group such that your Faspex server can access the RDS instance
  • Use MySQL 5.5.42 or earlier on your RDS instance.

 

2) Stop Faspex services and back up database

SSH into your FOD instance and perform the following.

# asctl faspex:stop
# asctl faspex:backup_database

 

 

3) Migrate Faspex database to RDS

From your FOD instance migrate your Faspex database into your RDS instance.

# /opt/aspera/common/mysql/bin/mysql -h [host IP] -P [port number] -u [user] -p[password] < /full/path/of/your/backup/database

For example

# /opt/aspera/common/mysql/bin/mysql -h 54.182.111.111 -P 3306 -u root -ptopsecret < /opt/aspera/faspex/backup/2015-07-01_234548/faspex.sql

 

4) Validate that migration is successful

To confirm that the data has been migrated, you should login to the RDS database and view the contents of the new database

 

# /opt/aspera/common/mysql/bin/mysql -h 54.182.111.111 -P 3306 -u root -ptopsecret
mysql> use faspex;
mysql> show tables;
mysql> select * from e_packages;

 

5) Configure Faspex to use this RDS database

Edit the following files to reflect the information of your RDS instance   

       a)  /opt/aspera/common/mysql/database.rb.yml

            You will need to update the hostname, port, and password in this file.

---
:version: 1.1.19.99169
:process_id:
:data_dir: /opt/aspera/common/mysql/data
:hostname: 54.182.111.111
:port: 3306
:task status:
...
...
:password: topsecret
:setup_complete: true

 

b) /opt/aspera/faspex/config/database.yml

    In the 'production' section you need to update the port, host and password settings.

 ...

production:
encoding: utf8
port: 3306
username: root
adapter: mysql
database: faspex
host: 54.182.111.111
user: root
password: topsecret

... 

 

 

6)  Shut down the local MySQL server, and restart all other Faspex services.

 

# asctl  mysql:disable
# asctl all:restart

 

NOTE:  If you need to re-enable the MySQL service, first revert the YML files back and then run the command 'asctl mysql:setup'.

 

 



Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk