code: func upgradeDBPathNet(oldDbPath, netName string) error {
  	// Prior to version 0.2.0, the database was named the same thing for
  	// both sqlite and leveldb.  Use heuristics to figure out the type
  	// of the database and move it to the new path and name introduced with
  	// version 0.2.0 accordingly.
  	fi, err := os.Stat(oldDbPath)
  	if err == nil {
  		oldDbType := "sqlite"
  		if fi.IsDir() {
  			oldDbType = "leveldb"
  		}
  
  		// The new database name is based on the database type and
  		// resides in a directory named after the network type.
  		newDbRoot := filepath.Join(filepath.Dir(cfg.DataDir), netName)
  		newDbName := blockDbNamePrefix + "_" + oldDbType
  		if oldDbType == "sqlite" {
  			newDbName = newDbName + ".db"
  		}
  		newDbPath := filepath.Join(newDbRoot, newDbName)
  
  		// Create the new path if needed.
  		err = os.MkdirAll(newDbRoot, 0700)
  		if err != nil {
  			return err
  		}
  
  		// Move and rename the old database.
  		err := os.Rename(oldDbPath, newDbPath)
  		if err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // upgradeDBPathNet moves the database for a specific network from its
  // location prior to btcd version 0.2.0 and uses heuristics to ascertain the old
  // database type to rename to the new format.