I have a production FreeBSD webserver which I would like to "clone" to create a development/preproduction server.
I've installed a clean FreeBSD server and now I would like to know if there's an easy way to list all the ports installed on the production server, get that list out and input that to the new server, so I can easily install all the same apps and same versions than in the production machine.
We are using:
FreeBSD 7.1
portmaster as a port manager
This is from the
EXAMPLES
section of theportmaster
man page:First, get a list of installed ports:
On your target system, use that list as input to
portmaster
:you need bash
mkdir -p /usr/local/pkg
cd /usr/local/pkg
for i in
pkg_info |cut -f 1 -d " "
; do pkg_create -b $i ; donethen, scp the resulting pkgs to the target server and install them by pkg_add * Then, copy over the /usr/local/etc of the source-server and copy any entries in /etc/rc.conf and related files that seem useful and appropriate.