Migrate WP from one VPS to other Debian 14
!!!!!!!!!!Obavezno proveriti docker disk default size !!!!!!!!!!!!!!!!!!!
sudo service docker stop
umount /var/lib/docker/devicemapper
sudo rm -rf /var/lib/docker
sudo dockerd --storage-opt dm.basesize=50G
sudo service docker start
docker run -p2222:22 -p 8000:8000 -p 80:80 -p 443:443 -p 3306:3306 -v /opt/ajentiserver/www:/var/www/ -v /opt/ajentiserver/data:/data -v /opt/ajentiserver/backup:/backup -v /opt/ajentiserver/mysql:/var/lib/mysql -e MYSQL_ADMIN_PASSWORD=Zovjunice89 -d blacktobacco/ajenti
Export:
mysqldump -u [uname] -p[pass] db_name > /var/www/wordpress/db_backup.sql //backup db
apt-get update #update list of apps and repo
sudo apt-get install zip //install zip if you dont have
cd /var/www/wordpress/ //go to public dir
//to speed up backuping clear cache if you use
zip -r site.zip /var/www/wordpress/* //zip site for faster transver
Import:
cd /var/www/wordpress/ //go to public directory
wget htpp://domain.com/site.zip //download zip from site you wont to migrate from
apt-get update #update list of apps and repo
sudo apt-get install unzip #install unzip if you dont have
unzip site.zip -d /var/www/wordpress/ #unzip site to public directory
sudo mv fromPath/ /var/www/wordpress/ #move if need
mysql -u <username> -p <databasename> < /var/www/wordpress/db_backup.sql //install database back
#enter password of mysql
chmod -R 755 /var/www/wordpress/* #This will modify the permissions of all files in the current folder and
set them to 755.
chmod -R 777 /var/www/wordpress/wp-content/* #This will modify the permissions of all files in the current folder and
#set them to 777 for read/write this is usualy fix new uploads .
nano /var/www/wordpress/wp-config.php //if database have different name and pass change it in new ones
#to exit from nano ctr+x and 2x enter to save
//in ajenti add this 3 configs
location / {
try_files $uri $uri/ /index.php?$args;
}
access_log /var/www/sites/virtuelnizivot/logs/access.log;
types{
application/json json;
}
echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list
wget -O - http://deb.goaccess.io/gnugpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install goaccess
nano /etc/goaccess.conf #cnange CLF
cat /opt/ajentiserver/www/sites/virtuelnizivot/logs/access.log | grep "`date +"%d/%b/%Y" --date="today"`" | goaccess -a -o json > /opt/ajentiserver/www/sites/virtuelnizivot/var/www/wordpress/reports/lastHour.json --no-progress --ignore-panel=VISITORS --ignore-panel=REQUESTS --ignore-panel=REQUESTS_STATIC --ignore-panel=NOT_FOUND --ignore-panel=OS --ignore-panel=BROWSERS --ignore-panel=VISIT_TIMES --ignore-panel=REFERRERS --ignore-panel=REFERRING_SITES --ignore-panel=STATUS_CODES --http-protocol=no --http-method=no
apt-get update
sudo apt-get install php5-curl
sudo apt-get install php5-gd
client_max_body_size 2M;
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
docker run -p2222:22 -p 8000:8000 -p 80:80 -p 443:443 -p 3306:3306 -v /var/www/clients/:/var/www/ -v /var/www/clients/data:/data -v /var/www/clients/backup:/backup -v /var/www/clients/mysql:/var/lib/mysql -e MYSQL_ADMIN_PASSWORD=Zovjunice89 -d blacktobacco/ajenti
ispconfig_server stop
service apache2 stop
/etc/init.d/ispconfig_server stop
http://www.rationallyparanoid.com/articles/tcpdump.html
sudo su
define('FS_METHOD','direct');
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress/* ./
// setup https
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04
https://askubuntu.com/questions/493460/how-to-install-add-apt-repository-using-the-terminal