MU-Migration icon indicating copy to clipboard operation
MU-Migration copied to clipboard

wpmu_new_blog is deprecated since version 5.1.0! Use wp_insert_site instead.

Open splaquet opened this issue 4 years ago • 5 comments

Describe the bug

I've noticed that running imports/migrations into new/different WPMU environments haven't worked the same as they previously had.

The issue is when I import a package into a new WPMU, it isn't creating a new subsite. It's going through all of the steps, but the only evidence is in the database. Database imports correctly with the next site ID, but there's no sign that a new site has been created in /WP/network/sites.php dashboard.

I've been able to work around these issues by creating a new subsite w/ slug, and then importing into that site_id. I had forgotten to pre-add the subsites this time. And, I had a brand new server with a brand new WPMU install on a brand new URL, so without any history or existing sites, I'm going to assume that the following error was caused/created by a MU-Migration import.

here's my CLI command: wp mu-migration import all vanillaexport.zip --new_url=vanilla.schittscreek.cloud --blog_id=2

here's the error line I found in the server's nginx access.log: 2021/05/01 19:37:05 [error] 389#0: *324 FastCGI sent in stderr: "PHP message: PHP Deprecated: wpmu_new_blog is <strong>deprecated</strong> since version 5.1.0! Use wp_insert_site instead. in /public_html/wp-includes/functions.php on line 5236" while reading response header from upstream, client: 162.158.63.91, server: newdomain.cloud, request: "POST /wp-admin/network/site-new.php?action=add-site HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "newdomain.cloud", referrer: "http://newdomain.cloud/wp-admin/network/site-new.php?id=2"

here's an error line that I just now found in the account's debug.log: PHP Warning: Attempt to read property "domain" on bool in /home/user/.wp-cli/packages/vendor/10up/mu-migration/includes/helpers.php on line 160

Steps to Reproduce

outlined above. please let me know if any clarification is needed.

Expected behavior new site is created (and visible in WPMU/network) after export has run

Environment information

  • Operating System: Amazon Linux 2

  • Kernel: Linux 5.10.29-27.126.amzn2.x86_64

  • Architecture: x86-64

  • brand new WPMU install

  • all plugins disabled on master network site ID 1

splaquet avatar May 03 '21 17:05 splaquet

Hi @splaquet, what was the MU-Migration plugin version?

sultann avatar May 10 '21 21:05 sultann

my apologies on leaving that part out. to my knowledge, it was the latest version available at the time (so, 10 days ago). i had just installed it using the 1-liner.

the script says /dev-master, but does not show a version number. am i missing something?

splaquet avatar May 10 '21 21:05 splaquet

Hi @splaquet could you please check if the issue still exists? I could not find any reference of the deprecated function wpmu_new_blog in the plugin.

sultann avatar May 24 '21 10:05 sultann

Huh. Are there any package dependencies that might be creating that?

I'll try and run another import when I'm back at my desk.

As I mentioned, this issue seems to pop out when importing a migration package into a natively created new blog/ID (from within the MU-migration package).

I do not see this issue when importing over an existing ID.

We're using the latest nightly WP-CLI builds, so I don't believe that's where it's coming from.

splaquet avatar May 24 '21 14:05 splaquet

@splaquet any updates on your testing of this and whether you're still seeing an issue here?

jeffpaul avatar Jul 12 '21 15:07 jeffpaul