All-in-One WP Migration Multisite Extension WP CLI Integration

All-in-One WP Migration Multisite Extension WP CLI Integration

Backup For Full Network

Creates a new backup file containing the entire network — all subsites, network tables, shared users, and media

wp ai1wm backup

Sample output (matching your published article’s style):

Backup in progress...
Success: Backup complete.
Backup file: ai1wm-mu-servmask-com-20240724-142646-cesazr.wpress
Backup location: /home/servmask/wordpress-mu/wp-content/ai1wm-backups/ai1wm-mu-servmask-com-20240724-142646-cesazr.wpress

wp ai1wm backup

OPTION DESCRIPTION EXAMPLE
[–password[=<password>]] Create a backup file that is encrypted and protected with a password. wp ai1wm backup –password=MySecurePass123
[–compression[=]] Create a backup file using the specified compression type. wp ai1wm backup –compression=gzip
[–exclude-spam-comments] Creates a backup file without spam comments. wp ai1wm backup –exclude-spam-comments
[–exclude-post-revisions] Creates a backup file without post revisions. wp ai1wm backup –exclude-post-revisions
[–exclude-media] Creates a backup file without media library files. wp ai1wm backup –exclude-media
[–exclude-themes] Creates a backup file without any themes. wp ai1wm backup –exclude-themes
[–exclude-inactive-themes] Creates a backup file without currently inactive themes. wp ai1wm backup –exclude-inactive-themes
[–exclude-muplugins] Creates a backup file without must-use plugins. wp ai1wm backup –exclude-muplugins
[–exclude-plugins] Creates a backup file without plugins. wp ai1wm backup –exclude-plugins
[–exclude-inactive-plugins] Creates a backup file without currently inactive plugins. wp ai1wm backup –exclude-inactive-plugins
[–exclude-cache] Creates a backup file without cache files. wp ai1wm backup –exclude-cache
[–exclude-database] Creates a backup file without the database. wp ai1wm backup –exclude-database
[–exclude-files[=<comma_separated_paths>]] Create a backup file that excludes selected files and folders. wp ai1wm backup –exclude-files=uploads/some-folder,plugins/some-plugin
[–exclude-tables[=<comma_separated_names>]] Create a backup file that excludes selected database tables. wp ai1wm backup –exclude-tables=wp_comments,wp_commentmeta
[–include-tables[=<comma_separated_names>]] Create a backup file that includes only the selected database tables. wp ai1wm backup –include-tables=wp_posts,wp_postmeta
[–exclude-email-replace] Creates a backup file without replacing the email domain. wp ai1wm backup –exclude-email-replace
[–replace “find” “replace”] Finds and replaces text in the database. Use –replace flag before each pair for replacement. wp ai1wm backup –replace “wordpress” “WordPress”
SIMULTANEOUS USE

 

All options be used simultaneously except –list can. Replace option could be used between other options. wp ai1wm backup–exclude-inactive-themes –replace “find” “replace” –exclude-cache –replace “old text” “new text”

Backup For Subsites and Sub-Domain Sites

Creates a new backup file.
Example:

wp ai1wm backup --sites Enter site ID (q=quit, l=list sites): l
+---------+-----------------------------------------------+
| blog_id | URL                                           |
+---------+-----------------------------------------------+
| 1       | https://ai1wm-mu.servmask.com/                |
+---------+-----------------------------------------------+

Enter site ID (q=quit, l=list sites): 1
Enter site ID (q=quit, l=list sites): 
Backup in progress...
Success: Backup complete.

Backup file: ai1wm-mu-servmask-com-20240724-142646-cesazr.wpress
Backup location: /home/servmask/wordpress-mu/wp-content/ai1wm-backups/ai1wm-mu-servmask-com-20240724-142646-cesazr.wpress

wp ai1wm backup –sites

OPTION DESCRIPTION EXAMPLE
[–exclude-spam-comments] Creates a backup file without spam comments. wp ai1wm backup –exclude-spam-comments
[–exclude-post-revisions] Creates a backup file without post revisions. wp ai1wm backup –exclude-post-revisions
[–exclude-media] Creates a backup file without media library files. wp ai1wm backup –exclude-media
[–exclude-themes] Creates a backup file without any themes. wp ai1wm backup –exclude-themes
[–exclude-inactive-themes] Creates a backup file without currently inactive themes. wp ai1wm backup –exclude-inactive-themes
[–exclude-muplugins] Creates a backup file without must-use plugins. wp ai1wm backup –exclude-muplugins
[–exclude-plugins] Creates a backup file without plugins. wp ai1wm backup –exclude-plugins
[–exclude-inactive-plugins] Creates a backup file without currently inactive plugins. wp ai1wm backup –exclude-inactive-plugins
[–exclude-cache] Creates a backup file without cache files. wp ai1wm backup –exclude-cache
[–exclude-database] Creates a backup file without the database. wp ai1wm backup –exclude-database
[–exclude-email-replace] Creates a backup file without replacing email domain. wp ai1wm backup –exclude-email-replace
[–replace “find” “replace”] Finds and replaces text in the database. Use –replace flag before each pair for replacement. wp ai1wm backup –replace “wordpress” “WordPress”
SIMULTANEOUS USE All options be used simultaneously except –list can. Replace option could be used between other options. wp ai1wm backup–exclude-inactive-themes –replace “find” “replace” –exclude-cache –replace “old text” “new text”

List backups

List backup files from Multisite.
Example:

wp ai1wm list-backups 
+-----------------------------------------------------+--------------+----------+
| Backup name                                         | Date created | Size     |
+-----------------------------------------------------+--------------+----------+
| ai1wm-mu-servmask-com-20240724-142646-cesazr.wpress | 7 mins ago   | 15.07 MB |
| ai1wm-mu-servmask-com-20240724-142442-fl8xjr.wpress | 9 mins ago   | 15.06 MB |
+-----------------------------------------------------+--------------+----------+

wp ai1wm list-backups

OPTION DESCRIPTION EXAMPLE
list-backups List backups in a specific folder. wp ai1wm list-backups

Restore backup

Restore a backup from a multisite

Example:

wp ai1wm restore migration-wp-00970913-895743-200.wpress.
OPTION DESCRIPTION EXAMPLE
[file] Download a backup from a specific file name inside your computer. wp ai1wm restore migration-wp-00970913-895743-200.wpress
[–yes] Auto-confirm the backup on restore. wp ai1wm restore migration-wp-00970913-895743-200.wpress –yes

Browse backup

Browse a backup from Multisite.
Example:

wp ai1wm browse-backup migration-wp-00970913-895743-200.wpress.
OPTION DESCRIPTION EXAMPLE
[backup-file] Download a backup from a specific file name inside your computer. wp ai1wm browse-backup migration-wp-00970913-895743-200.wpress

Extract backup

Extract a backup from Multisite.
Example:

wp ai1wm extract-backup migration-wp-00970913-895743-200.wpress –extract-path=/tmp/test
OPTION DESCRIPTION EXAMPLE
[backup-file] Download a backup from a specific file name inside your computer. wp ai1wm extract-backup migration-wp-09913-89573-2100.wpress
[–extract-path] Create a destination folder path to extract your backup. wp ai1wm extract-backup migration-wp-09913-89573-2100.wpress –extract-path=/tmp/test

Reset backup

Resets the selected part of your WordPress site.

Example:

wp ai1wm reset database --user=admin --backup

Syntax:

wp ai1wm reset <type> --user=<id|login|email> [--backup]

 RESET OPTIONS

OPTION DESCRIPTION EXAMPLE
<type> The type of reset to perform: database, themes, plugins and media.
[VERIFY exact accepted values against the command class before publishing]

wp ai1wm reset database –user=admin

–user=<id|login|email>

Required. The WordPress user to perform the reset as the user can be specified by ID, login, or email address. This user account is preserved and can log in after the reset completes.

wp ai1wm reset database –user=1

[–backup] Optional. Creates a backup file of your site before performing the reset. The backup is stored in the ai1wm-backups folder and can be restored at any time.

wp ai1wm reset plugins –user=admin –backup

RESET TYPES

TYPE DESCRIPTION EXAMPLE
database Resets the WordPress database to a fresh installation state. All posts, pages, comments, and settings are removed. Files, themes, and plugins are not affected.

wp ai1wm reset database –user=admin –backup

themes Removes all installed themes. [VERIFY: Does it reinstall the default theme?]

wp ai1wm reset themes –user=admin –backup

plugins Removes all installed plugins except All-in-One WP Migration. [VERIFY exclusion list]

wp ai1wm reset plugins –user=admin –backup

media Removes all files from the media library and the uploads folder.

wp ai1wm reset media –user=admin –backup

EXAMPLES

Reset the database as user ID 1:

wp ai1wm reset database --user=1

Reset themes, specifying the user by login:

wp ai1wm reset themes --user=admin

Reset plugins, specifying the user by email:

wp ai1wm reset plugins --user=ad***@*****le.com

Create a backup before resetting the database (recommended):

wp ai1wm reset database --user=admin --backup