Documentation

WP-CLI Command – Import Subcommand

wp migratedb import <import-file>
  [--find=<strings>]
  [--replace=<strings>]
  [--regex-find=<strings>]
  [--regex-replace=<strings>] 
  [--case-sensitive-find=<strings>]
  [--case-sensitive-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.

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

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

  Should be used in conjunction with the --regex-find=<strings> argument.

  A replace string may contain references of the form \n or $n, with the latter
  form being the preferred one. Every such reference will be replaced by the text 
  captured by the n'th parenthesized pattern used in the --regex-find pattern.

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

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

[--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.