The MU forums have moved to

wpmu upgrade / wpmu-upgrade-site.php error / 'post_type' column not found (3 posts)

  1. berniq
    Posted 18 years ago #

    allready posted this ..but after forum-update ..some topics got is my old post:

    found my post with google-cache:

    i'm trying to upgrade from wmpu-2005-09-17 to 2006-03-23
    and i got some problems....

    installed all files + plugins, conf-files ... ok.
    after that i need to run those upgrade script..

    as admin -for the all sites: /wp-admin/wpmu-upgrade-site.php

    i get error-messages like:

    Warning: fopen(http://**domain**/wp-admin/upgrade.php?step=1): failed to open stream: Connection refused in /home/wordpress-dev/wpmu-2006-03-23/wp-inst/wp-admin/wpmu-upgrade-site.php on line 27

    if i try to upgrade a site manually (by copying the fopen-link) ..the update works !!
    mhhh whats the probleme here ???

    after doing a manuall upgrade of a site ..i get a lot of the same error messages like:

    WordPress database error: [Unknown column 'post_type' in 'where clause']
    SELECT count(*) FROM wp_440_posts WHERE post_status='publish' AND post_type='post'

    content + is ok. maybe a theme update would help with the post_Type column error ??

    thanks for help,

    fimion recommended me the following patch:
    which actually didn't work.
    any idea ?

  2. kahless
    Posted 18 years ago #

    Here is what I have for lines 24-49 of wpmu-upgrade-site.php

    $blogs = $wpdb->get_results( "SELECT * FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT $n, 5", ARRAY_A );
    if( is_array( $blogs ) ) {
    foreach( $blogs as $details ) {
    if( $details[ 'spam' ] == 0 && $details[ 'deleted' ] == 0 && $details[ 'archived' ] == 0 ) {
    $siteurl = $wpdb->get_var( "SELECT option_value from {$wpmuBaseTablePrefix}{$details[ 'blog_id' ]}_options WHERE option_name = 'siteurl'" );
    print "$siteurl<br>";
    $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" );
    if( $fp ) {
    while( feof( $fp ) == false ) {
    fgets($fp, 4096);
    fclose( $fp );
    //while a bit slower than fopen (i'm guessing),
    //This will definitely work if allow_url_fopen is off.
    $client = new Snoopy();
    @$client->fetch($siteurl . "wp-admin/upgrade.php?step=1");
    //else {
    //print "Not upgrading: {$details[ 'domain' ]}<br>";

    It works on DreamHost haven't debugged the nesting of ifs to get Not upgrading message to work. Line 27 has changed since the patch was created and that is what causes the errors when the patch is run.

  3. berniq
    Posted 18 years ago #

    thanks kahless ---
    pasting your code into the file worked :)

About this Topic