Guest User

Untitled

a guest
Oct 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. # SPIN Migration Upload Guide
  2. ***
  3. ## Upload File Preparation
  4. 1. Wait for ICCBS to dump `con_bb_spin_{YYYYMMDD_HHMISS}.csv` file
  5. - Sample File: `con_bb_spin_20181016_023725.csv`
  6. 2. Create an upload file that will be used as an input file to the upload script to be executed later
  7. - Upload file must contain data from the following files:
  8. 1. `con_bb_spin_{YYYYMMDD_HHMISS}.csv`
  9. 2. `bbapp_canero_roz_v4.csv`
  10. - File must be in CSV (Comma Separated Value) format
  11. - File must be in UNIX format (line ending must be in LF)
  12. - Do not include column name in the first line
  13. - File Sample content:
  14. ```
  15. 840485646,decmae1218@globelines.com.ph
  16. 867390424,dec16121400420@globelines.com.ph
  17. 878313960,dec18101300391@globelines.com.ph
  18. 878302620,dec18101200682@globelines.com.ph
  19. 878316499,dec18101300646@globelines.com.ph
  20. ```
  21. 3. Upload the created file into AWS S3 and set permission to public
  22. 4. Login to PRODUCTION DB via MySQL Workbench
  23. 5. Truncate `pcrf` table.
  24. ```sql
  25. TRUNCATE TABLE `pcrf`;
  26. ```
  27.  
  28. ## Uploading the File using the Upload Script
  29. 1. Login to CMS PROD via `ssh`:
  30. ```bash
  31. ssh bbaadm@10.237.180.211
  32. bash
  33. ```
  34. 2. Switch to `su` user
  35. ```bash
  36. sudo su
  37. ```
  38. 3. Download the file from S3 using `wget`
  39. ```bash
  40. wget <DOWNLOAD_URL_HERE>
  41. ```
  42. 4. Load the environment configuration
  43. ```bash
  44. . /home/bbaadm/bb-parser-db-prod.config
  45. ```
  46. 5. Run the `bb-parser.php` script
  47. ```bash
  48. /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
  49. ```
  50. 6. Wait for execution to finish
  51.  
  52. ## Validating the uploaded data
  53. 1. Login to `PRODUCTION DB` via `MySQL Workbench`
  54. 2. Query the record count of `pcrf` table.
  55. ```sql
  56. SELECT COUNT(1)
  57. FROM `pcrf`;
  58. ```
  59. 3. Check the result if same with record count of merged data
  60.  
  61. #bbapp/guide
Add Comment
Please, Sign In to add comment