• This plugin isn’t supported anymore (right?) it seems.

    We’re having an issue where MySQL views aren’t being duplicated: https://prnt.sc/OwRdBDq8nd4j

    Which makes total sense, but wondered if anybody had an alternate plugin that had additional features.

    Otherwise we’ll ask our devs to see what we can do built-in.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Vincent Poirier

    (@magikweb)

    Also, if someone wants it to clone views as well, edit /wp-content/plugins/multisite-clone-duplicator/lib/data.php at L53:

    // Get sources Tables

    if($from_site_id == MUCD_PRIMARY_SITE_ID) {

        $from_site_table = self::get_primary_tables($from_site_prefix);

    }

    else {

        $sql_query = $wpdb->prepare('SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = \'%s\' AND TABLE_NAME LIKE \'%s\'', $schema, $from_site_prefix_like . '%');

        $from_site_table =  self::do_sql_query($sql_query, 'results');

    }

    foreach ($from_site_table as $table) {

        $table_name = $to_site_prefix . substr( $table['TABLE_NAME'], $from_site_prefix_length );

        if ( 'BASE TABLE' == $table['TABLE_TYPE'] ) {

            // Drop table if exists

            self::do_sql_query('DROP TABLE IF EXISTS
    ' . $table_name . '');

            // Create new table from source table

            self::do_sql_query('CREATE TABLE IF NOT EXISTS ' . $table_name . ' LIKE ' . $schema . '.' . $table['TABLE_NAME'] . '');

            // Populate database with data from source table

            self::do_sql_query('INSERT ' . $table_name . ' SELECT * FROM ' . $schema . '.' . $table['TABLE_NAME'] . '');

        } elseif ( 'VIEW' == $table['TABLE_TYPE'] ) {

            // Drop view if exists

            self::do_sql_query('DROP VIEW IF EXISTS ' . $table_name . '');

            // Create new view from source view

            self::do_sql_query('CREATE VIEW ' . $table_name . ' AS SELECT * FROM ' . $schema . '.' . $table['TABLE_NAME'] . ';');

        }

    }
    Norm

    (@casualmagic)

    I switched to NS Clone and the free version suited my needs.

    It looks like the views question is address in their free version too. Not coping the users was the only feature missing from Pro, but manually adding after the clone wasn’t a problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.