code: private void addAlmostAll(final Project newProject, final Project oldProject) {
      final Hashtable<String,Object> properties = oldProject.getProperties();
      final Enumeration<String> e = properties.keys();
      while (e.hasMoreElements()) {
        final String key = e.nextElement();
        if (!(MagicNames.PROJECT_BASEDIR.equals(key) || MagicNames.ANT_FILE.equals(key))) {
          if (newProject.getProperty(key) == null) { newProject.setNewProperty(key, (String)properties.get(key)); }
        }
      }
    }
docs: Russel Winder rehacked the code provided by Eric Van Dewoestine.