Migrating to Kinsta from WP Engine

Go to https://my.kinsta.com/sites and select add site.

screen-shot-2016-12-02-at-3-57-07-pm

Next upload ssh key for to enable password less SSH.

cat ~/.ssh/id_rsa.pub | ssh user@XXX.XXX.XXX.XXX -p XXXXX 'cat >> .ssh/authorized_keys'

Now SSH login ssh user@XXX.XXX.XXX.XXX -p XXXXX. On WP Engine panel make a snapshot and download. Copy the Amazon S3 snapshot link from email and run through the following commands on Kinsta.

function anchor_prep {
 mkdir ~/downloads
 cd ~/downloads
 read -p $'\e[31mWP Engine download link\e[0m: ' downloadlink
 wget $downloadlink
 filename=`ls site-*`
 unzip $filename
 rm -f $filename
 rm -rf ~/public/wp-content/ # Removes current wp-content
 mv ~/downloads/wp-content/ ~/public/wp-content/ # Restore wp-content from snapshot
 rm -rf ~/public/wp-content/mu-plugins
 rm -f ~/public/wp-content/advanced-cache.php
 rm -f ~/public/wp-content/object-cache.php
 cd ~/public/
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
 chmod 600 ~/public/wp-content/mysql.sql
 cd ~/public/
 wp db import ~/public/wp-content/mysql.sql
 siteurl=`wp option get siteurl`
 siteurlhttp=${siteurl/https:/http:}
 wp search-replace $siteurl $siteurlhttp --all-tables
}
anchor_prep

This will prep the Kinsta site by creating a new script for running database backups, downloading the WP Engine snapshot, removing a few WP Engine specific things and resetting permissions. There are a few other things to take care of before going live.

  • Add domain mappings in Kinsta.
  • Install and activate a coming soon plugin on WP Engine.
  • Flush WP Engine cache. This will prevent any changes while switching over.
  • On WP Engine, open PHPMyAdmin and export all tables with the drop tables option checked.
  • Upload your database backup to download folder and run the following:
cd ~/public/
wp db import ~/downloads/wp_databasename.sql
wp search-replace https://anchor.host https://anchor.host --all-tables ## Turns off SSL
rm -rf ~/downloads
mkdir ~/downloads
siteurl=`wp option get siteurl`
siteurlhttp=${siteurl/http:/https:}
wp search-replace $siteurl $siteurlhttp --all-tables