• Using the CLI portion of this plugin:

    wp site duplicate --source=3 --slug=mysubsite --title="AE - SUB | Site" --keep_users [email protected] --path=/opt/rh/httpd24/root/var/www/html --v

    I get a host of errors like these:

    Warning: array_diff_key(): Argument #2 is not an array in phar:///usr/local/bin/wp/vendor/wp-cli/role-command/src/Role_Command.php on line 345
    PHP Warning:  array_diff_key(): Argument #1 is not an array in phar:///usr/local/bin/wp/vendor/wp-cli/role-command/src/Role_Command.php on line 346
    

    On inspection of the new blog through the GUI, the drop-down for roles (either to edit an existing user or create a new one) is empty.

    I’ve resorted to a kludge in my script to re-set the roles, which seems to make them available (in Perl):

    foreach my $blogrole(qw(administrator subscriber editor author)){
       my $roleresult = qx{wp role reset $blogrole --url=$urlroot --path=$path};
    }
  • The topic ‘Roles not being duplicated in CLI’ is closed to new replies.