Skip to content

Instantly share code, notes, and snippets.

@Niq1982
Last active February 21, 2024 04:00
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Niq1982/7b02c735d55d20395c655637d0491e74 to your computer and use it in GitHub Desktop.
Save Niq1982/7b02c735d55d20395c655637d0491e74 to your computer and use it in GitHub Desktop.
Site migration using All in One WP Migration and WP CLI

Do a backup

Install the plugin

wp plugin install all-in-one-wp-migration --activate

You must reload the page once before continuing

Do the backup

Adjust the settings for your own need, this here makes a backup of the database only. I suggest using rsync to sync media files.

wp ai1wm backup --exclude-media --exclude-themes --exclude-inactive-themes --exclude-muplugins --exclude-plugins --exclude-inactive-plugins --exclude-cache

Remove the plugin

wp plugin deactivate all-in-one-wp-migration --uninstall

Restore a backup

Go to backup directory or create if does not exist

cd wp-content/ai1wm-backups/

Download the backup

wget http://siteurl.fi/wp-content/ai1wm-backups/backup-20180105-142530-313.wpress

Install the plugin

wp plugin install all-in-one-wp-migration --activate

You must reload the page once before continuing

Restore the site from backup

wp ai1wm restore backup-20180105-142530-313.wpress

Not sure if necessary to flush permalinks twice, like when restoring from front end, but do it once or twice if you encounter problems.

wp rewrite flush

Remove the plugin and delete the backup file

wp plugin deactivate all-in-one-wp-migration --uninstall

rm backup-20180105-142530-313.wpress

Remember to remove the unneeded backup files from the source as well

@ramonfincken
Copy link

On the target site:

wp option update blog_public 0

along with any rm of files such as advanced-cache.php

@rguillermo
Copy link

This currently require the 'unlimited' plugin, which is paid

@ramonfincken
Copy link

That is correct @rguillermo

@ThejusAP
Copy link

How to install the paid All in One plugin zip file version through WP CLI?

@ramonfincken
Copy link

you need to have a public ZIP location of which you can install it

@ThejusAP
Copy link

I am having the paid plugin .zip file with me, I have copied it to the root directory . Is it the same command as installing normal plugins?
eg. wp plugin install all-in-one-wp-paid.zip --activate

@ramonfincken
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment