# How to install ports using old distfiles



## ph0enix (Jul 31, 2012)

I have a FreeBSD 7.1 system with a lot of outdated packages on it.  I need to replicate it in a test environment and I don't know what the best way of doing that is.  I have installed 7.1 on a new machine and copied the contents of /usr/ports/distfiles from the existing system to it but I'm not sure how to compile all the old software along with the dependencies.  Any suggestions would be greatly appreciated.

Thanks! 

J.


----------



## SirDice (Jul 31, 2012)

FreeBSD 7.1 went End-of-Life in February 2011. It's not supported anymore.

The best way would be to install 7.4 and migrate.


----------



## ph0enix (Jul 31, 2012)

SirDice said:
			
		

> FreeBSD 7.1 went End-of-Life in February 2011. It's not supported anymore.
> 
> The best way would be to install 7.4 and migrate.



I understand that 7.1 is not supported anymore but I can't really upgrade the system at this time so I'm wondering if there is a way to use the old distfiles to compile the software.

Thank you! 

J.


----------



## da1 (Jul 31, 2012)

If you need a 1:1 copy, try dd.

If not, get a list of installed ports and ... well, start with 1 and work your way down.


----------



## SirDice (Jul 31, 2012)

Iterate through /var/db/pkg/, use pkg_create(1) to create packages from existing (installed) ports/packages. Move those to your "new" server.

When that's done plan the upgrade to 7.4.


----------



## wblock@ (Jul 31, 2012)

There are better tools than dd(1) to duplicate a system.  dump(8)/restore(8) are made for that.  See Backup Options For FreeBSD.


----------



## ph0enix (Jul 31, 2012)

SirDice said:
			
		

> Iterate through /var/db/pkg/, use pkg_create(1) to create packages from existing (installed) ports/packages. Move those to your "new" server.
> 
> When that's done plan the upgrade to 7.4.



pkg_create(1) worked great!  Thank you!  The plan is to upgrade to either 8.x or 9.x in the near future.


----------



## SirDice (Aug 1, 2012)

ph0enix said:
			
		

> The plan is to upgrade to either 8.x or 9.x in the near future.


That's even better!


----------

