WordPress.org

Forums

SharDB
[resolved] Problem with VIP blog (10 posts)

  1. Mike
    Member
    Posted 1 year ago #

    I set my site up to use the home database, and 1 vip database for the tags blog (blog_id=2).
    The migration worked fine, but WordPress tries to load the wp_2_xxx tables from the home database, instead of the vip1 database, resulting in errors.

    /* Add your configuration here */
    // how many characters of hexidecimal hash
    $shardb_hash_length = 1;
    // what is the prefix of your blog database shards (everything before the hexidecimal hash)
    $shardb_prefix = 'wp_myblog_';
    // set a string to be used as an internal identifier for the dataset
    $shardb_dataset = 'myblog';
    // do you want to put your primary blog (blog_id 1) in its own 'home' database?
    $enable_home_db = true;
    // how many, if any, VIP databases do you have?
    $num_vipdbs = 1;
    // add this if all of your databases are on a local server
    $shardb_local_db = true;

    At the bottom of the db-settings.php page:

    add_vip_blog( 2, 'vip1' ); // tags blog

    WordPress is 3.8.1, Buddypress is 1.9.1

    Is this correct in dp.php:

    // VIP Blog Check.
    // Added by: Luke Poland
    		if ( is_array( $vip_db ) && array_key_exists( $table_blog_id, $vip_db )) {
    			$partition = $shardb_num_db + intval( $vip_db[ $table_blog_id ] );
    		}

    considering that $vip_db[ $table_blog_id ] is a string, something like
    'wp_myblog_vip1'?

    Thanks,
    Mike

    https://wordpress.org/plugins/shardb/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    What is your global DB called? And vip1?

    Is this correct in dp.php:

    Code has been there since the original version (4+ years ago): https://plugins.trac.wordpress.org/browser/shardb/trunk/db.php?rev=186372#L550

  3. Mike
    Member
    Posted 1 year ago #

    Hi,
    My global table is wp_myblog_global and my vip1 table is wp_myblog_vip1.
    So I have the first sixteen databases and 3 more:

    wp_myblog_0
    wp_myblog_1
    .
    .
    .
    wp_myblog_global
    wp_myblog_home
    wp_myblog_vip1

    The error message shows that the wp_2_xxx tables are being searched for in wp_myblog_home, though I have set blog with id=2 to be vip1

    Mike

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Did you add this line to the end of the db-settings file?

    add_vip_blog( 2, 'vip1' ); // tags blog

  5. Mike
    Member
    Posted 1 year ago #

    Yup, see my first post above.

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    How many sites do you have?

  7. Lemmy
    Member
    Posted 1 year ago #

    --
    ignore, posted in error

  8. Mike
    Member
    Posted 1 year ago #

    On the instance where I tested it, around 24. On my live site, close to 5000.

  9. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Since this is a test install, try turning off the enable home DB. (Your configuration looks correct so I'm trying to isolate why it's not working.)

  10. Mike
    Member
    Posted 1 year ago #

    I went ahead without using the vip table feature, just to get it working. I will try to run some tests using vip again if I get a chance.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • SharDB
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic