MCCC Server Migration
Steps
Create snapshot of existing dev server in DO
Create new scaled up VM in DO based off of snapshot
Setup SSH key
Create a new msyqldump of DB
Clone https://github.com/ag-informatics/covercrops-species-selector-MCCC int
/var/www/html
Copy
/var/www/html/covercroptool
and/var/www/html/vegtool
into/var/www/html/covercroptool/covercrops-species-selector-MCCC
in order to view server changesPush server changes to GitHub
Create PR into main
Create a new server in Azure
Clone
feature/server_changes
branch into/var/www/html
Install MySQL
create user 'mccc' idntified by 'mccc_pass';
grant all privileges on cctool_data.* to mccc;
Didn’t realize that
/var/www/html/covercrops
was a build folder and did the following to figure out changesCopy php.cfg from r
Copy nuxt.config.js (doesn’t exist, taken from root copy)
Copy package.json (deleted from server for some reason. taken from repo)
Copy deploy.sh (doesn’t exist, taken from root copy)
npm run dev
this failed, server changes deleted/assets
Copy
/assets
from servernpm run dev
worked but can’t connect remotely
Install npm, node.js
npm i
Install server version of node.js
sudo npm cache clean -f
sudo npm install -g n
sudo n 16.15.0
Allow azure VM to receive HTTP, HTTPS traffic, Can’t connect remotely
Realize that the non build code lives in
/root/covercrops-species-selector-MCCC
Copy the php files from
/var/www/html/covercroptool
into/root/covercrops-species-selector-MCCC
because they were changed liveMake a new PR
Setup apache
sudo apt install apache2
copy
sites-enabled
Install PHP
sudo apt install --no-install-recommends php8.1
sudo apt-get install libapache2-mod-php php-mysql
sudo reboot