Documentation

WP-CLI Command – Import Subcommand

wp migratedb import <import-file>
    [--find=<strings>]
    [--replace=<strings>]
    [--backup=<prefix|selected|table_one,table_two,table_etc>]

Import an SQL file into the database.

Options

<import-file>
 The path of the SQL file to import.

[--find=<strings>]
 A comma separated list of strings to find when performing a string find
 and replace across the database.

 Table names should be quoted as needed, i.e. when using a comma in the
 find/replace string.

 The --replace=<strings> argument should be used in conjunction to specify
 the replace values for the strings found using this argument. The number
 of strings specified in this argument should match the number passed into
 --replace=<strings> argument.

[--replace=<strings>]
 A comma separated list of replace value strings to implement when
 performing a string find & replace across the database.

 Should be used in conjunction with the --find=<strings> argument, see it's
 documentation for further explanation of the find & replace functionality.

[--backup=<prefix|selected|table_one,table_two,table_etc>]

 Perform a backup of the destination site's database tables before replacing it.

 Accepted values:

 * prefix - Backup only tables that begin with your installation's
            table prefix (e.g. wp_)
 * selected - Backup only tables selected for migration (as in --include-tables)
 * A comma separated list of the tables to backup.