exporting small subsite(s) with basic wp_ tables: Error: Something went wrong while trying to export the database
Chuckworld opened this issue · 10 comments
wp mu-migration export all site.zip --plugins --themes --uploads --blog_id=2
Exporting site meta data...
Exporting users...
Exporting tables
Error: Something went wrong while trying to export the database
The above command is an attempt to export the tiniest of subsites , yet it produces this error. Other blog_id numbers do the same thing. This is a multisite w/subdomains, php 5.6 and CentOS 5.X- or 6.X
What commonly triggers this message?
Does wp db export
work if you run it separately? That's what the tool uses to export the database. Also, make sure you have mysqldump in your server, which is the tool used by wp db export
.
Yes it runs
Same issue here with wp db export
running without error (mamp 4.2, php 7.1.8, mysql 5.6.35).
A good debugging step might be to add these lines to includes/commands/class-mu-migration-export.php
:
148 if ( is_array( $tables ) && ! empty( $tables ) ) {
* echo $filename;
* print_r( $tables );
149 $export = \WP_CLI::launch_self(
And run the mu-migration export. This should print out the two arguments that are being passed to wp db export
from inside mu-migration -- maybe there are irregularities.
It's definitely something with the the params.
Does wp db tables
output anything? Alternatively, you can try what @azito122 suggest to debug (if you're open to hack the code a bit)
I've solved the problem @Chuckworld by replacing
$export = \WP_CLI::launch_self(
'db export',
array( $filename ),
array( 'tables' => implode( ',', $tables ) ),
false,
false,
array()
);
on around line 148 and replace it with
$export = \WP_CLI::runcommand('db export', array('return' => true));
However, I'm stuck with zipping the folder now. It doesn't want to zip it but the data looks all fine.
I've just merged a PR #61 that might fix this.
@adamshand Thanks for confirming.
While this does indeed appear to be fixed in the main repo while using it as a plugin, the wp cli package still has the problem.