Last active
June 14, 2023 19:06
-
-
Save JPaulMora/139c3d10d290022d4676d423b141fdca to your computer and use it in GitHub Desktop.
WordOps full server migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## WordOps (https://wordops.net/) migration guide/script. | |
# - This is still in development. | |
# - most commands will work just as they are. | |
# - Keep in mind there are some manual instructions. | |
## Wordops setup in new server | |
# This is the easiest way to get all the dependencies going in the new host. | |
# 1. Install | |
# 2. Create site with --wpce | |
# 3. wo stack install --admin | |
# Wordops Directories | |
/etc/wo | |
/var/lib/wo/ | |
# Nginx | |
/etc/nginx/sites-available | |
/etc/nginx/sites-enabled | |
/etc/nginx/conf.d/force-ssl*.conf | |
# Lets encrypt export | |
/etc/letsencrypt/ | |
/etc/letsencrypt/config/account.conf | |
## MySQL Export | |
# Config used by WO, here's your root password | |
/etc/mysql/conf.d/my.cnf | |
# Dump DB | |
pass=$SQL_ROOT_PASS | |
threads=8 | |
/usr/bin/mysqldump -u root -p$pass -A -R -E --triggers --single-transaction > wordops_websites_dump.sql | |
# Export users and permissions | |
echo 'FLUSH PRIVILEGES;' >> wordops_websites_dump.sql | |
/usr/bin/mysqldump -u root -p$pass --system=users >> wordops_websites_dump.sql | |
# Delete access.log and error.log in /var/www/* (Optional, recommended). | |
find /var/www/ -name access.log -exec rm {} \; | |
find /var/www/ -name error.log -exec rm {} \; | |
# Rsync data from remote to new server | |
rsync -avz --progress root@$OLD_SRV_IP:/root/ homebkp | |
rsync -avz --progress root@$OLD_SRV_IP:/var/lib/wo/ /var/lib/wo/ | |
rsync -avz --progress root@$OLD_SRV_IP:/var/www/ /var/www/ | |
rsync -avz --progress root@$OLD_SRV_IP:/etc/nginx/sites-available/ /etc/nginx/sites-available/ | |
rsync -avz --progress root@$OLD_SRV_IP:/etc/nginx/sites-enabled/ /etc/nginx/sites-enabled | |
rsync -avz --progress root@$OLD_SRV_IP:/etc/nginx/conf.d/force-ssl*.conf /etc/nginx/conf.d/ | |
rsync -avz --progress root@$OLD_SRV_IP:/root/wordops_websites_dump.sql wordops_websites_dump.sql | |
# Now you can restore the database, everything should be in place just check nginx (and cloudflare probably). | |
# DONE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment