# Revert Ports Tree



## dave (Dec 11, 2012)

What is the simplest way to roll back the ports tree to an earlier (previous) verison?


----------



## UNIXgod (Dec 11, 2012)

The whole tree? There is a utility called portdowngrade. Maybe it can help you.


----------



## wblock@ (Dec 11, 2012)

Not for long, portdowngrade is based on CVS.  svn can get an earlier version, but the way it works is not what you might expect:
http://svnbook.red-bean.com/en/1.7/...erging.html#svn.branchmerge.basicmerging.undo


----------



## dave (Dec 11, 2012)

I wanted the whole tree, because I was working on a dated machine and wanted to roll the ports tree back to a version where the existing ports had been built in order to add a php module without having to do a massive upgrade and potentially run into compatibility issues.  Here's what I did:

I accessed the SVN web interface for ports and found the revision I was looking for (by narrowing the revision until I found a certain date).

Then, I checked that out using subversion read-only:

```
svn co -r [your revision number] http://svn.freebsd.org/ports/head ./ports
```

Then, I removed the .svn directory from that download, and copied the tree to the target system, renamed the existing /usr/ports folder, and copied the specific revision into place.  Built my extension, and it worked fine.


----------

