An operation example of online mall migration
Online mall migrates and modifies database password and IP
Let's take one of the malls as an example, and all the other malls have the same operation.
Cd / home/webserver/
Tar zxvf nkwshop.tar.gz
Rm-rf nkwshop.tar.gz
Change IP to new ip
Change mysql password to new password
Vim nkwshop/webapps/onlineshop/WEB-INF/classes/config.properties
Jdbc.url=jdbc:mysql://new IP:3306/nkwshop
Jdbc.password=new password
Cd nkwshop/logs
Rm-rf $tomcat/logs/*
[root@localhost webserver] # ll nkwshop/webapps/
Drwxr-xr-x 16 root root 4096 Apr 5 03:51 onlineshop
Drwxr-xr-x 16 root root 4096 Apr 5 03:51 onlineshopbak
[root@localhost webserver] # rm-f nkwshop/webapps/onlineshopbak
After completing the above three steps, return to the parent directory, pack it, and put it in the tar.gz directory
Tar cvf nkwshop.tar.gz nkwshop
Mv nkwshop.tar.gz tar.gz/
Log in to the database and create a mall database nkwshop
Mysql-uroot-pnew password
Mysql > create database nkwshop
Mysql > show databases
Mysql-uroot-pnew password nkwshop < nkwshop.sql
Mv nkwshop.sql tar.gz
Start the Tomcat service
Nkwshop/bin/startup.sh
Then go to the mall table to find the IP port of the corresponding mall name.
Enter IP (new IP) in the browser: the corresponding mall IP port
If you use IP: Port, it is normal to access several pages in the browser.
Go to the mall form to find the corresponding domain name, and send it to the CDN engineer for domain name resolution.
After the CDN engineer has changed the domain name resolution, he will use the domain name to go to the browser to access the test.