From owner-freebsd-questions@FreeBSD.ORG Wed Dec 17 14:21:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B263F1065687 for ; Wed, 17 Dec 2008 14:21:02 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: from mail-fx0-f11.google.com (mail-fx0-f11.google.com [209.85.220.11]) by mx1.freebsd.org (Postfix) with ESMTP id 121F68FC27 for ; Wed, 17 Dec 2008 14:21:01 +0000 (UTC) (envelope-from andrewlylegould@gmail.com) Received: by fxm4 with SMTP id 4so171418fxm.19 for ; Wed, 17 Dec 2008 06:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=hXIs2NiTfcOoVAHLT16IKdczRkGXPhwWwBbdiN2zjT8=; b=i86C32/0FgDBZ5V+AGOgm8Ma7IjJLyn/0gxxWXWWlWIhsAxv57OHK94jArl7jHFYLe YKbZd5KbTtnB3SesIMg7L/J4h0vn/iXq1siz/KQT7TB/6rUuQaRobsZwQEv6/Hkzvldi /wTwtaI3o1D+HnRLbi8De96t2762RpgzxZOmA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=qwV5d2QmFc4a30KfAaVaHXBmuoJqsM9u6DawzOgU6CucB1kQy3H8lURvZW5iCLlcqU U2YhnugRm6jp1pV/r86xeMMmNYYpPqP46+VbqWVcAAiXwWaX3+avWyflLQMR0oA/Ei3O GwgsYR41QbBxtSbNXn0rplZN+LJVHoZNQ2EXU= Received: by 10.102.218.5 with SMTP id q5mr280310mug.99.1229523660820; Wed, 17 Dec 2008 06:21:00 -0800 (PST) Received: by 10.103.220.3 with HTTP; Wed, 17 Dec 2008 06:21:00 -0800 (PST) Message-ID: Date: Wed, 17 Dec 2008 08:21:00 -0600 From: "Andrew Gould" To: Mel In-Reply-To: <200812170900.53046.fbsd.questions@rachie.is-a-geek.net> MIME-Version: 1.0 References: <829861.58495.qm@web53407.mail.re2.yahoo.com> <200812170900.53046.fbsd.questions@rachie.is-a-geek.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org, bg271828@yahoo.com Subject: Re: Copying system/ports configuration? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 14:21:02 -0000 On Wed, Dec 17, 2008 at 2:00 AM, Mel wrote: > On Tuesday 16 December 2008 16:16:27 Andrew Gould wrote: > > On Tue, Dec 16, 2008 at 9:03 AM, Dr. Jennifer Nussbaum > > > > wrote: > > > I have a FreeBSD 7.0 system that im using in production. I want to > create > > > a FreeBSD virtual machine, to use as a testbed for this production box. > > > > > > The last time i did this it took a lot of time to get the VM set > > > up--installing all the right ports, getting the database configuration > > > right, etc. > > > > > > Are there any shortcuts for this, e.g. a way i can automatically > install > > > the same ports on the new "machine"? I didnt see anything in the > handbook > > > or FAQ about this, but id think that people need to do this all the > time. > > > Any other advice for mirroring the system? > > > > > > Thanks! > > > > > > Jen > > > > Someone once posted a shell script that obtained a list of installed > ports > > from the package database system and fed the results to pkg_create, which > > would create binary packages. Unfortunately, I can't locate the script. > > cd /var/db/pkg > mkdir /var/tmp/packages > for DIR in *; do > if test -d ${DIR} -a -f ${DIR}/+CONTENTS; do > pkg_create -vb ${DIR} /var/tmp/packages/${DIR}.tbz > fi > done > > This will create a package for all installed software in /var/tmp/packages. > Adjust accordingly. > > Once ssh is in place on target: > scp -rp /var/tmp/packages target.machine:/var/tmp > > On target: > cd /var/tmp/packages > for FILE in *; do pkg_add ${FILE}; done > > Then all that's left is /usr/local/etc/ and possibly some > dirs /usr/local/share. > -- > Mel > > Problem with today's modular software: they start with the modules > and never get to the software part. > Thanks, Mel. Andrew