diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
new file mode 100644
index 773bb07..d1f302a
*** a/contrib/pg_upgrade/pg_upgrade.c
--- b/contrib/pg_upgrade/pg_upgrade.c
*************** create_new_objects(void)
*** 363,384 ****
  }
  
  /*
!  * Delete the given subdirectory contents from the new cluster, and copy the
!  * files from the old cluster into it.
   */
  static void
! copy_subdir_files(char *subdir)
  {
- 	char		old_path[MAXPGPATH];
  	char		new_path[MAXPGPATH];
  
  	prep_status("Deleting files from new %s", subdir);
  
- 	snprintf(old_path, sizeof(old_path), "%s/%s", old_cluster.pgdata, subdir);
  	snprintf(new_path, sizeof(new_path), "%s/%s", new_cluster.pgdata, subdir);
! 	if (!rmtree(new_path, true))
  		pg_fatal("could not delete directory \"%s\"\n", new_path);
  	check_ok();
  
  	prep_status("Copying old %s to new server", subdir);
  
--- 363,397 ----
  }
  
  /*
!  * Delete the given subdirectory contents from the new cluster
   */
  static void
! rm_new_subdir_files(char *subdir, bool rmtopdir)
  {
  	char		new_path[MAXPGPATH];
  
  	prep_status("Deleting files from new %s", subdir);
  
  	snprintf(new_path, sizeof(new_path), "%s/%s", new_cluster.pgdata, subdir);
! 	if (!rmtree(new_path, rmtopdir))
  		pg_fatal("could not delete directory \"%s\"\n", new_path);
+ 
  	check_ok();
+ }
+ 
+ /*
+  * Copy the files from the old cluster into it
+  */
+ static void
+ copy_subdir_files(char *subdir)
+ {
+ 	char		old_path[MAXPGPATH];
+ 	char		new_path[MAXPGPATH];
+ 
+ 	rm_new_subdir_files(subdir, true);
+ 
+ 	snprintf(old_path, sizeof(old_path), "%s/%s", old_cluster.pgdata, subdir);
+ 	snprintf(new_path, sizeof(new_path), "%s/%s", new_cluster.pgdata, subdir);
  
  	prep_status("Copying old %s to new server", subdir);
  
*************** copy_clog_xlog_xid(void)
*** 419,424 ****
--- 432,438 ----
  	{
  		copy_subdir_files("pg_multixact/offsets");
  		copy_subdir_files("pg_multixact/members");
+ 
  		prep_status("Setting next multixact ID and offset for new cluster");
  
  		/*
*************** copy_clog_xlog_xid(void)
*** 436,441 ****
--- 450,462 ----
  	}
  	else if (new_cluster.controldata.cat_ver >= MULTIXACT_FORMATCHANGE_CAT_VER)
  	{
+ 		/*
+ 		 * Remove files created by initdb that no longer match the
+ 		 * new multi-xid value.
+ 		 */
+ 		rm_new_subdir_files("pg_multixact/offsets", false);
+ 		rm_new_subdir_files("pg_multixact/members", false);
+ 
  		prep_status("Setting oldest multixact ID on new cluster");
  
  		/*
