Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.