Here are the steps I did to achieve that:
Step 1 : Installed openedx instance say 'Instance-1' which is your running Web node(Web-server)
Step 2 : Execute the following commands to back up the database on 'Instance-1'
mongodump -o ./mongo-backup
mongorestore -drop ./mongo-backup
mysqldump -u root -p --all-databases > ./backup.sql
mysql -u root -p < ./backup.sql
Step 3 : Setup an instance of mysql on AWS-RD with URL like: 'http://instance1.123456789012.us-east-1.rds.amazonaws.com/'(If want to you mongodb & mysqlDB on same instance. that is going to work as well.)
Step 4 : Import the Mysql databse data into AWS-RD from Open-edX backup using command: 'mysql -h <endpoint> -u <username> -p < ./backup.sql'
Step 5 : Setup a new Ubuntu instance say 'Instance-2' for mongodb/mysql or for both, so install mongodb/mysql over there by running folowing commands:
To Install MongoDB:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
To Install Mysql:
sudo apt-get install mysql-server
Step 6 : Then import mongodb data on 'Instance-2'.
Step 7 : Then copy the exported file to the server and import into mongodb
```mongorestore -drop ./mongo-backup```
Steps 8 : Change the mongodb and mysql host address in the following files:
```lms.auth.json
cms.auth.json
ora.auth.json
xqueue.auth.json
forum/forum_env
```
Step 9: In the edx servers you can stop the mysql and mongodb services. To prevent them to start when booting the system, create the text files /etc/init/mysql.override and /etc/init/mongodb.override with the string: 'manual' into them.
Step 10 : If you are using 'ubuntu 16.04' Then do following change sin file : sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
On mysql server >>> change : 'bind-address = 0.0.0.0'.
On web node server do the changes :'bind-address = IP address of mysql server'
If you are using 'Ubuntu 12.04': Then do following change sin file : sudo nano /etc/mysql/my.cnf
On mysql server >>> change : 'bind-address = 0.0.0.0'.
On web node server do the changes :'bind-address = IP address of mysql server'
Step 11 : After MySQL changes Run following commands on MySQL server:
sudo systemctl restart mysql.service
sudo service mysql restart
Step 12: Login to MySQL DB to Grant all permission's by running following commands:
Login to MySQL :
MySQL -u root
[ GRANT ALL ON <local database name>.* TO <remote web node user name>@<remote web node server ip address> IDENTIFIED BY '<database user password>';]
GRANT ALL ON *.* TO dbuser@192.0.2.50 IDENTIFIED BY 'dbuserpassword';
FLUSH PRIVILEGES;
Step 13: Change Mongo-DB related changes in file: 'sudo nano /etc/mongodb.conf'
Change the follwing points:
bind_ip = 0.0.0.0
port = 27017
Steps 14: Lastly shutdown and disable MongoDB and MySQL on the local instance.
Steps 15: Test LMS CMS are accessible.
Reference Links:
1. https://github.com/edx/configuration/wiki/Preparation-For-Production-Launch
2. https://support.plesk.com/hc/en-us/articles/213904365-How-to-enable-remote-access-to-MySQL-database-server
3. http://devdocs.magento.com/guides/v2.0/install-gde/prereq/mysql_remote.html
4. https://help.ubuntu.com/16.04/serverguide/mysql.html