MCCC Server Migration

Steps

  1. Create snapshot of existing dev server in DO

  2. Create new scaled up VM in DO based off of snapshot

  3. Setup SSH key

  4. Create a new msyqldump of DB

  5. Clone https://github.com/ag-informatics/covercrops-species-selector-MCCC int /var/www/html

  6. Copy /var/www/html/covercroptool and /var/www/html/vegtool into /var/www/html/covercroptool/covercrops-species-selector-MCCC in order to view server changes

  7. Push server changes to GitHub

  8. Create PR into main

  9. Create a new server in Azure

  10. Clone feature/server_changes branch into /var/www/html

  11. Install MySQL

  12. create user 'mccc' idntified by 'mccc_pass';

  13. grant all privileges on cctool_data.* to mccc;

  14. Didn’t realize that /var/www/html/covercrops was a build folder and did the following to figure out changes

    1. Copy php.cfg from r

    2. Copy nuxt.config.js (doesn’t exist, taken from root copy)

    3. Copy package.json (deleted from server for some reason. taken from repo)

    4. Copy deploy.sh (doesn’t exist, taken from root copy)

    5. npm run dev this failed, server changes deleted /assets

    6. Copy /assets from server

    7. npm run dev worked but can’t connect remotely

  15. Install npm, node.js

  16. npm i

  17. Install server version of node.js

    1. sudo npm cache clean -f

    2. sudo npm install -g n

    3. sudo n 16.15.0

  18. Allow azure VM to receive HTTP, HTTPS traffic, Can’t connect remotely

  19. Realize that the non build code lives in /root/covercrops-species-selector-MCCC

  20. Copy the php files from /var/www/html/covercroptool into /root/covercrops-species-selector-MCCC because they were changed live

  21. Make a new PR

  22. Setup apache

    1. sudo apt install apache2

    2. copy sites-enabled

  23. Install PHP

    1. sudo apt install --no-install-recommends php8.1

  24. sudo apt-get install libapache2-mod-php php-mysql

  25. sudo reboot