code: func resourceVSphereFolderMigrateState(version int, os *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) {
  	// Guard against a nil state.
  	if os == nil {
  		return nil, nil
  	}
  
  	// Guard against empty state, can't do anything with it
  	if os.Empty() {
  		return os, nil
  	}
  
  	var migrateFunc func(*terraform.InstanceState, interface{}) error
  	switch version {
  	case 0:
  		log.Printf("[DEBUG] Migrating vsphere_folder state: old v%d state: %#v", version, os)
  		migrateFunc = resourceVSphereFolderMigrateStateV1
  	default:
  		// Migration is complete
  		log.Printf("[DEBUG] Migrating vsphere_folder state: completed v%d state: %#v", version, os)
  		return os, nil
  	}
  	if err := migrateFunc(os, meta); err != nil {
  		return nil, err
  	}
  	version++
  	log.Printf("[DEBUG] Migrating vsphere_folder state: new v%d state: %#v", version, os)
  	return resourceVSphereFolderMigrateState(version, os, meta)
  }
docs: // resourceVSphereFolderMigrateState is the master state migration function for
  // the vsphere_folder resource.