Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#39325 closed defect (bug) (duplicate)

All sites automatically marked as archived after upgrade

Reported by: rscs's profile rscs Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

I upgraded my Multisite Network from v4.6.1 to v4.7 today. After the upgrade, all of the sites in my network were marked as archived. I manually went into the db and changed the archive column from "1" to "0" to fix the problem. It looks like the "archived" column in the "wp_blogs" table was changed from an enum to a tinyint based on reviewing by DB backups.

I'm not sure why I am just seeing this schema change now when it took effect over 3 years ago in r25448.

This is a legacy setup originally installed from v3.4.2.

Related: #27832 and #38856

Database before upgrade:

CREATE TABLE `wp_blogs` (
  `blog_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `site_id` bigint(20) NOT NULL DEFAULT '0',
  `domain` varchar(200) NOT NULL DEFAULT '',
  `path` varchar(100) NOT NULL DEFAULT '',
  `registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `public` tinyint(2) NOT NULL DEFAULT '1',
  `archived` enum('0','1') NOT NULL DEFAULT '0',
  `mature` tinyint(2) NOT NULL DEFAULT '0',
  `spam` tinyint(2) NOT NULL DEFAULT '0',
  `deleted` tinyint(2) NOT NULL DEFAULT '0',
  `lang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`blog_id`),
  KEY `domain` (`domain`(50),`path`(5)),
  KEY `lang_id` (`lang_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

Database after upgrade:

CREATE TABLE `wp_blogs` (
  `blog_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `site_id` bigint(20) NOT NULL DEFAULT '0',
  `domain` varchar(200) NOT NULL DEFAULT '',
  `path` varchar(100) NOT NULL DEFAULT '',
  `registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `public` tinyint(2) NOT NULL DEFAULT '1',
  `archived` tinyint(2) NOT NULL DEFAULT '0',
  `mature` tinyint(2) NOT NULL DEFAULT '0',
  `spam` tinyint(2) NOT NULL DEFAULT '0',
  `deleted` tinyint(2) NOT NULL DEFAULT '0',
  `lang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`blog_id`),
  KEY `domain` (`domain`(50),`path`(5)),
  KEY `lang_id` (`lang_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

Change History (4)

#1 @rscs
8 years ago

Confirmed that my DB version was 37965 before the upgrade.

#2 @johnjamesjacoby
8 years ago

Thanks for creating this issue, and sorry you ran into it (in addition to the other related issues.)

Setting the DO_NOT_UPGRADE_GLOBAL_TABLES constant is the best preventative against similar issues going forward.

Seems odd the DB version comparison would be bypassed.

Last edited 8 years ago by johnjamesjacoby (previous) (diff)

#3 @mitraval192
8 years ago

the database version on 4.7 is (db_version in wp_options) changed to 38590, and the Trac revision was 39524. Hope it's work for you!

#4 @jeremyfelt
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 4.7 deleted

Indeed, thanks for all of this information. I'm going to close this ticket as a duplicate of #27832 so that we can track it in one ticket. I'll mention this there as well.

Note: See TracTickets for help on using tickets.