I have Redhat Linux Server with Apache, Oracle and PHP. I am using this server as a production server, and I want to create a new test server with the same configurations/product versions as the production server. Is there any way to copy all the installation/configurations from production and install/copy on the other server.
migrated from superuser.com Jun 15 '11 at 5:46
This question came from our site for computer enthusiasts and power users.
Assuming you've installed everything from packages from the official repositories the process would be:
To get the package list in step 1 under Debian or similar use
I'm not overly familiar with
It is also a good idea, though not required (the configuration should be present in the backup of
Edit, re: Oracle:
As you list Oracle as one of the things you have installed, you don't have everything installed from packages (unless Oracle is installed via a custom repo in which case add that repo to the new server's config before step 5 and it might work). You'll need to consult the Oracle documentation (or an Oracle expert) to see how to backup all the required files and configuration and restore this to the target machines.
Alternately you could just take an image the machine's hard-drive(s) (with something as simple as
You can replicate the set of installed packages like this:
This will work well as long as your development server does not already have a newer version of the package installed (because yum doesn't like to downgrade packages).
As Mr. Spillet said, if you have packages that have been installed outside of your normal list of repositories you'll have to deal with those by hand.
In general, replicating the configuration files is a manual process unless you have taken steps to record on the production server which files have been modified from their stock configuration. We often use a version control system (like git) for this purpose. Assuming that all your installed packages are well behaved, you might be able to do something like this to get a list of configuration files:
Assuming ssh access between the two systems, you could then do something like this to copy them all over to your development server:
...however, I'm not sure that I'd recommend this in process, because it's liable to overwrite something on your target system that has system-specific information (i.e., that is somehow hardware-specific). If you adopt some sort of version control this becomes less problematic (because you can identify changes and revert them as necessary).