fastest way to duplicate production server?

Darren Pilgrim dmp at bitfreak.org
Tue Jul 12 22:06:40 GMT 2005


From: RC <rubbishcollector at yahoo.com>
> 
> We have a production FreeBSD 4.10 server running old versions 
> of Apache/MySQL/PHP from ports.  We'd like to upgrade 
> Apache/MySQL/PHP to the latest versions.  Before upgrading 
> we'd like to test on a test box.
> 
> What's the fastest way of duplicating the existing 
> Apache/MySQL/PHP (including user databases)?  (The production 
> server cannot go down for more than a few seconds.)

Make per-filesystem back-ups of everything excluding those files opened
read-write by whatever services you're running (ignore log files).  Use
nice to run the backup at a priority low enough to not usurp resources
from the production services.  Stop whatever services are running.  Use
fstat to make sure the excluded files are closed.  Make a backup of the
files excluded from the first backup run (again, ignore logs).  Restart
whatever services you stopped.

If you can get away with it, flip the volumes read-only before doing the
backup, it can make things just a little bit faster.



More information about the freebsd-isp mailing list