Disappearing text widgets

Multi-DB 3.0.5, WP 3.1

On at least two separate custom themes, when I upgrade or downgrade Multi-DB, all text widgets are lost. Other widget types are preserved (as far as I can tell), but all text widgets disappear. This is repeatable (but a major PITA to correct). Any ideas how I can prevent this and the best way to recover the data from my backups? In multiple tests, reverting portions (widget_% and %sidebar% keys), or even the entire options table for the blog will not fix it.

Currently, I'm reviewing the google cache for each blog and manually recreating it from the source. This is insane.

Any ideas?

  • Philip John

    Hi Shawn!

    Sorry to hear about the problems you're having with text widgets.

    Can you confirm that you still get this issue on a standard theme like Twenty Ten? Also, do you still get this when only Multi-DB is activated?

    Please confirm those bits and we can move on to see where next.

    It would also be useful if you could provide PHP error logs as there may be a clue in there.

    Phil

  • Shawn

    This occurs immediately upon replacing the db.php file with a different version and hitting the site. The FIRST view immediately erases the text widgets from each sidebar. Reverting to the prior db.php file after the first page load is "too late" as the data is already gone.

    Unfortunately, I'm really not keen on testing it or changing themes, as doing so would add at least 45+ minutes to my work day recreating text widgets (this has happened about 5 or 6 times now). It's also a client site in the middle of a sale, so they'd probably string me up for playing with it like that.

    Here's my db-config.php file. You'll see a couple changes to the structure, which I implemented to simplify the code. The functional aspects are the same.

    <?php
    //------------------------------------------------------------------------//
    //	Plugin Name: Multi-DB
    //	Plugin URI: https://premium.wpmudev.org/project/Multiple-Databases
    //	Author: Andrew Billits (Incsub)
    //  Version: 2.9.2
    //------------------------------------------------------------------------//
    //---DB Scaling-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	16,256,4096
    define ('DB_SCALING', '4096');
    
    //------------------------------------------------------------------------//
    //---DC IPs---------------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Usage: add_dc_ip(IP, DC)
    //	EX: add_dc_ip('123.123.123.', 'dc1');
    add_dc_ip('207.44.147.', 'dc1');
    
    //------------------------------------------------------------------------//
    //---Global Tables--------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Do not include default global tables
    //	Leave off base prefix (eg: wp_)
    //
    //	Usage: add_global_table(TABLE_NAME)
    //	EX: add_global_table('something');
    add_global_table('blog_versions');
    add_global_table('blogs');
    add_global_table('blogs_cets_topic');
    add_global_table('blogs_cets_topic_relationship');
    add_global_table('bp_activity');
    add_global_table('bp_activity_meta');
    add_global_table('bp_friends');
    add_global_table('bp_groups');
    add_global_table('bp_groups_calendars');
    add_global_table('bp_groups_groupmeta');
    add_global_table('bp_groups_members');
    add_global_table('bp_messages_messages');
    add_global_table('bp_messages_notices');
    add_global_table('bp_messages_recipients');
    add_global_table('bp_notifications');
    add_global_table('bp_user_blogs');
    add_global_table('bp_user_blogs_blogmeta');
    add_global_table('bp_xprofile_data');
    add_global_table('bp_xprofile_fields');
    add_global_table('bp_xprofile_groups');
    add_global_table('comment_archive');
    add_global_table('moderation_reports');
    add_global_table('moderation_warnings');
    add_global_table('post_archive');
    add_global_table('registration_log');
    add_global_table('reports_comment_activity');
    add_global_table('reports_post_activity');
    add_global_table('reports_user_activity');
    add_global_table('signups');
    add_global_table('site');
    add_global_table('site_posts');
    add_global_table('sitecategories');
    add_global_table('sitemeta');
    add_global_table('support_faq');
    add_global_table('support_faq_cats');
    add_global_table('support_tickets');
    add_global_table('support_tickets_cats');
    add_global_table('support_tickets_messages');
    add_global_table('supporters');
    add_global_table('supporter_signup_stats');
    add_global_table('supporter_daily_stats');
    add_global_table('supporter_ads');
    add_global_table('system_faq');
    add_global_table('system_faq_cats');
    add_global_table('system_tickets');
    add_global_table('system_tickets_cats');
    add_global_table('system_tickets_messages');
    add_global_table('term_counts');
    add_global_table('tips');
    add_global_table('usermeta');
    add_global_table('users');
    add_global_table('ust');
    
    //------------------------------------------------------------------------//
    //---DB Servers-----------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Database servers grouped by dataset.
    //	R can be 0 (no reads) or a positive integer indicating the order
    //	in which to attempt communication (all locals, then all remotes)
    //
    //	Usage: add_db_server(DS, DC, READ, WRITE, HOST, LAN_HOST, NAME, USER, PASS)
    //	EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser',  'globalpassword');
    //
    //	Note: you can also place this section in a file called db-list.php in wp-content
    //  EX: add_db_server('global', 'dc1', 1, 1,'global.mysql.example.com:3509','global.mysql.example.lan:3509', 'global-db', 'globaluser',  'globalpassword');
    
    //------------------------------------------------------------------------//
    function multidblist(){
      $prefix = "IGNORE";
    	$user = "IGNORE";
    	$pass = "IGNORE";
    	$h = '';
    	$x = '';
    	echo "<html><head><style>body, p{margin:1px; padding:0;}</style></head><body>\t\n";
    	echo "<p>CREATE DATABASE IF NOT EXISTS <code>&quot; . $prefix . &quot;global</code> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;</p>\r\n";
    	echo "<p>GRANT ALL ON <code>&quot; . $prefix . &quot;global&quot; . &quot;</code>.* TO '" . $user . "'@'localhost' IDENTIFIED BY '" . $pass . "';</p>\r\n";
    	for ($i = 0; $i < 4096; $i++) {
    	  $h = $i;
    		$x = str_pad(dechex($h), 3, "0", STR_PAD_LEFT);
    		echo "<p>CREATE DATABASE IF NOT EXISTS <code>&quot; . $prefix . $x . &quot;</code> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;</p>\r\n";
    		echo "<p>GRANT ALL ON <code>&quot; . $prefix . $x . &quot;</code>.* TO '" . $user . "'@'localhost' IDENTIFIED BY '" . $pass . "';</p>\r\n";
    	}
    	echo "<p>FLUSH PRIVILEGES;</p>\t\n";
    	echo "</body></html>\t\n";
    }
    
    //------------------------------------------------------------------------//
    function multidbmap(){
      $prefix = "IGNORE";
    	$user = "IGNORE";
    	$pass = "IGNORE";
    	$h = '';
    	$x = '';
    	add_db_server('global', 'dc1', 1, 1,'localhost','localhost', $prefix . 'global', $user, $pass);
    	for ($i = 0; $i < 4096; $i++) {
    	  $h = $i;
    		$x = str_pad(dechex($h), 3, "0", STR_PAD_LEFT);
    		add_db_server($x, 'dc1', 1, 1,'localhost','localhost', $prefix . $x, $user, $pass);
    	}
    }
    //------------------------------------------------------------------------//
    multidbmap();
    //------------------------------------------------------------------------//
    
    //------------------------------------------------------------------------//
    //---VIP Blogs------------------------------------------------------------//
    //------------------------------------------------------------------------//
    //	Usage: add_vip_blog(BLOG_ID, DS)
    //	EX: add_vip_blog(1, 'vip1');
    
    //add_vip_blog(1, 'global');
    
    ?>