Details
-
Type: New Feature
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:
-
Epic Link:
-
Sprint:Summer 2019 Sprint 8, Summer 2019 Sprint 9
Attachments
Activity
Sai Charan Reddy Vallapureddy (Inactive)
created issue -
Sai Charan Reddy Vallapureddy (Inactive)
made changes -
Field | Original Value | New Value |
---|---|---|
Epic Link | IGBF-1388 [ 17463 ] |
Sai Charan Reddy Vallapureddy (Inactive)
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Sai Charan Reddy Vallapureddy (Inactive)
made changes -
Status | In Progress [ 3 ] | Needs Testing [ 10002 ] |
Ann Loraine
made changes -
Sprint | Summer 2019 Sprint 8 [ 67 ] | Summer 2019 Sprint 8, Summer 2019 Sprint 9 [ 67, 68 ] |
Ann Loraine
made changes -
Rank | Ranked higher |
Ann Loraine
made changes -
Resolution | Done [ 10000 ] | |
Status | Needs Testing [ 10002 ] | Closed [ 6 ] |
Ann Loraine
made changes -
Workflow | Loraine Lab Workflow [ 18526 ] | Fall 2019 Workflow Update [ 20217 ] |
Ann Loraine
made changes -
Issue Type | Bug [ 1 ] | New Feature [ 2 ] |
Ann Loraine
made changes -
Workflow | Fall 2019 Workflow Update [ 20217 ] | Revised Fall 2019 Workflow Update [ 22355 ] |
[~aloraine]
Migrate Appstore from sqllite3 to MySQL(rds)
Steps:
1. Create a mysql database in Amazon RDS.
2. Log in to the database. (Note: Install MySQL before this step)
Log in Commands:
mysql -h HOSTNAME -u USERNAME -p"PASSWORD"
3. Create a dedicated user to Appstore application.
Create commands:
create user username@'%' identified by "password"; (any server)
create user username@'101.%.%.%' identified by "password";
create user username@'usildb' identified by "password"; (user can only open from usildb server)
4. Create Database
CREATE DATABASE myproject CHARACTER SET UTF8;
5. Grant all privileges to application user
GRANT ALL PRIVILEGES ON myproject.* TO myprojectuser@localhost;
6. Save the privileges
FLUSH PRIVILEGES;
7. exit from the mysql shell.
8. Configure settings.py in appstore/appstore.
{ 'ENGINE': 'django.db.backends.mysql', 'NAME': 'myproject', 'USER': 'myprojectuser(applicationuser)', 'PASSWORD': 'password', 'HOST': 'rds-mysql-host', 'PORT': '3306', }DATABASES = {
'default':
}
or
DATABASES = {
{ 'read_default_file': '/etc/mysql/my.cnf', }'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS':
,
}
}
/etc/mysql/my.cnf:
[client]
database = DB_NAME
host = localhost
user = DB_USER
password = DB_PASSWORD
default-character-set = utf8
9. Install mysqlDB
pip install wheel
pip install mysqlclient
Then, edit the _init_.py file in your project origin dir(the same as settings.py)
import pymysql
pymysql.install_as_MySQLdb()
10. Remove migrations files from below locations.
rm /var/www/vhosts/appstore/apps/migrations/0001_initial.py
rm /var/www/vhosts/appstore/download/migrations/0001_initial.py
rm /var/www/vhosts/appstore/submit_app/migrations/0001_initial.py
11.load tables and load data
python manage.py makemigrations
python manage.py migrate
python manage.py loaddata appsDB.json
python manage.py rebuild_index
12.Give write permissions to the newly created whoosh_index file
sudo chown -R www-data:www-data /var/www/vhosts/appstore/appstore/whoosh_index
13.Restart Apache
sudo service apache2 restart