0

I have a CentOS production server that I am currently doing my development on (I know this is awful) I'm bringing on some new developers and I want to set up appropriate development, staging and production servers. My questions is how can I best replicate my production server environment on both my staging, and local development servers. For staging I want it to be almost exactly the same as my production server (Other than hardware specs). So I would like to get all my installed packages and configurations in my production CentOS server to my staging server. For my local development servers, I would like to only have the bare essentials to test and run the code. I know that things like puppet and chef exist to help do this, but I have not found anything that allows me to replicate the systems I have currently operating.

Thanks in advance!

1
  • is it a VM? you could just snapshot it and copy it as a dev version
    – kafka
    Feb 12, 2015 at 15:25

2 Answers 2

1

From a package-management standpoint, you could dump all installed packages into a file with

rpm -qa > /root/packages.txt

Transfer the file to the "new" machines and run:

yum -y install $(cat packages.txt)

Then you can just copy over your configuration files & code.

0

The usual way to do this on any UNIX system is to use the appropriate dump/restore software. For a Centos this is xfsdump/zfsrestore for dumping/restoring XFS filesystems, dump for ext2/ext3/ext4 filesystems and restore from the dump package to restore previously taken dump.

You should also recreate the fdisk/gpt/LVM/whatever layout, and format the filesystems before doing that. There's plenty of resources in the Internet describing this, so I'll probably leave this out of the scope of my answer. Any way, having dumps you can experiment on a new machine or in virtual environment.

The whole sequence will give you the exact clone of your system at the moment of taking the dump. One of the huge benefits also includes the independence from the size of your physical disks, ability to change the disk partition scheme/layout in the process, and probably the ability to add/remove the LVM from the equation, dependicg on your personal point of view.

And of course you can take incremental dumps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .