Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SPIN Migration Upload Guide
- ***
- ## Upload File Preparation
- 1. Wait for ICCBS to dump `con_bb_spin_{YYYYMMDD_HHMISS}.csv` file
- - Sample File: `con_bb_spin_20181016_023725.csv`
- 2. Create an upload file that will be used as an input file to the upload script to be executed later
- - Upload file must contain data from the following files:
- 1. `con_bb_spin_{YYYYMMDD_HHMISS}.csv`
- 2. `bbapp_canero_roz_v4.csv`
- - File must be in CSV (Comma Separated Value) format
- - File must be in UNIX format (line ending must be in LF)
- - Do not include column name in the first line
- - File Sample content:
- ```
- 840485646,decmae1218@globelines.com.ph
- 867390424,dec16121400420@globelines.com.ph
- 878313960,dec18101300391@globelines.com.ph
- 878302620,dec18101200682@globelines.com.ph
- 878316499,dec18101300646@globelines.com.ph
- ```
- 3. Upload the created file into AWS S3 and set permission to public
- 4. Login to PRODUCTION DB via MySQL Workbench
- 5. Truncate `pcrf` table.
- ```sql
- TRUNCATE TABLE `pcrf`;
- ```
- ## Uploading the File using the Upload Script
- 1. Login to CMS PROD via `ssh`:
- ```bash
- ssh bbaadm@10.237.180.211
- bash
- ```
- 2. Switch to `su` user
- ```bash
- sudo su
- ```
- 3. Download the file from S3 using `wget`
- ```bash
- wget <DOWNLOAD_URL_HERE>
- ```
- 4. Load the environment configuration
- ```bash
- . /home/bbaadm/bb-parser-db-prod.config
- ```
- 5. Run the `bb-parser.php` script
- ```bash
- /usr/bin/php /home/bbaadm/bbparser.php --pcrf=<absolute_path_to_downloaded_file> --servername=$DB_HOST --dbname=$DB_NAME --username=$DB_USER --password=$DB_PASSWORD
- ```
- 6. Wait for execution to finish
- ## Validating the uploaded data
- 1. Login to `PRODUCTION DB` via `MySQL Workbench`
- 2. Query the record count of `pcrf` table.
- ```sql
- SELECT COUNT(1)
- FROM `pcrf`;
- ```
- 3. Check the result if same with record count of merged data
- #bbapp/guide
Add Comment
Please, Sign In to add comment