I migrated a WordPress site from an old server to a new server, so I’ll roughly introduce the procedure.
mysqldump --default-character-set=binary -h localhost -u dbuser -p dbname > backup.sql
Next, compress the contents directory below the wordpress content placed in /var/www/vhosts/codenote.net with tar.
cd /var/www/vhosts/
tar zcvf codenote.net.tar.gz codenote.net/
Transfer backup.sql and codenote.net.tar.gz to the destination server.
# mysql -u root
mysql> create database dbname;
mysql> grant all on dbuser.* to dbname@localhost identified by 'mypassword';
mysql -u dbuser -p dbname < backup.sql
Extract the backed up WordPress content compressed file under /var/www/vhosts/.
cd /var/www/vhosts/
tar zxvf codenote.net.tar.gz
As a precaution, make all owners the same as the web server user.
chown -R nginx. /var/www/vhosts/codenote.net
That’s all from the Gemba.