Skip to content

Instantly share code, notes, and snippets.

@pitabas106
Last active August 24, 2019 00:59
Show Gist options
  • Save pitabas106/70b2eecaadb916c000210c38da0e677f to your computer and use it in GitHub Desktop.
Save pitabas106/70b2eecaadb916c000210c38da0e677f to your computer and use it in GitHub Desktop.
Instruction for Migrate WordPress Multisite

Here are the basic steps to migrate

  1. Modify wp-config.php and .htaccess files.

  2. Modify the follwing database tables.

    • wp_options and wp_{blog_id}_options tables
      -- Change the fields site_url and home.

    • wp_blogs table
      -- Change the domain and path fields with the new values.

    • wp_site table
      -- Change the domain and path fields with the new values.

    • wp_sitemeta table
      -- Change the site_url field

  3. Use WP CLI's search and replace commands to replace the old values to new values.

    • Run search/replace operation but dont save in database
      $ wp search-replace 'SEARCH_VALUE' 'REPLACE_VALUE' --dry-run

    • Search and replace but skip one column
      $ wp search-replace 'http://example.com' 'http://example.com' --skip-columns=guid

    For more details commands please check the WP CLI doc.

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