Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Duplicating a set-up

  • 04-07-2003 9:40am
    #1
    Closed Accounts Posts: 304 ✭✭


    I've a box here in the office specially configured as a copy or our live webserver by one of our Unix admins in the UK.

    Now I want to try and be inventive and set up a CMS on it, as the one we're currently using is crap.

    However, due to the highly specific nature of our web server configuration I recon there's about a 60% chance that the CMS I'm looking to install will just fail outright, and about a 60% chance that if it does succeed, it'll break the configuration of the server in the process.

    Now, back to the actual point. I'm wondering if there's any easy way to duplicate a system across a network so I can muck about with the second one and if it breaks the setup, well so what, I can always start again.

    I'm thinking of perhaps booting from a knoppix CD or something, and just copying the whole file system across the network to the local HD. I should be able to get a PC that's nearly identical to the original.

    Any thoughts, ideas, suggestions? Anyone here who's actually done this sort of thing before?

    <edit>
    Should have mentioned that the base OS is RedHat 7.3
    </edit>


Comments

  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    Hi Zaltais,
    this should be quite straightforward.
    You shouldn't be thinking in terms of duplicating the machine,
    you should be thinking in terms of BACKING IT UP!

    Do you have enough space on another machine for a full backup?
    It doesn't matter how similar to the other one it is for now.

    Two of the easiest things to use for the backup are tar and rsync as they deal with permissions, ownerships and special files (like dev entries) well.

    Knoppix is a good idea, boot it up with knoppix 2 if you're tight on RAM, you won't need the GUI.
    If your filesystems on the Redhat system are ext3, depending on which version of Knoppix you have you may need to type modprobe ext3 as it sometimes doesn't autoload it

    Make a directory like /Production and mount your root partition there.
    cd /Production and mount any other partitions you might have such as /home on /Production/home etc.

    Once you have that set up, you can
    cd /Production
    tar czv . | ssh username@backuphost cat - > BACKUPFILE.tar.gz


    You now have a backup that can be restored by mounting your drives in the same way and typing

    ssh username@backuphost cat BACKUPFILE.tar.gz | tar xvzf -

    Now you can add your CMS to your hearts content and if it breaks, revert to your backup.

    You can probably get away with a much smaller backup though. Think about what will be affected with each step of the CMS install.

    tar czvf /home/webapp.tar.gz /etc/httpd/ /etc/php.conf /var/www
    should get what is needed offside for a quick repair if it goes wrong.

    What CMS are you planning on setting up - Do you need java or is it php or cgi based?
    ----
    You can use rsync to duplicate to another machine.
    Have a partition or disk mounted on the backuphost and boot your Knoppix in the same way.
    rsync -avz -e ssh --numeric-ids /Production/ username@backuphost:/mnt/BackupPartition/

    The numeric-ids is important as you are backing it up from knoppix which will have a different user list.
    The trailing slashes are important too!

    This backup can be restored like this.
    rsync -avz -e ssh --numeric-ids username@backuphost:/mnt/BackupPartition/ /Production/

    The advantage of this method is that you can rerun the command as often as you like and it will only transfer changes that have taken place - speeding up the process by orders of magnitude.

    Hope that helps,
    you should try backing up first and then restoring to the almost similar box you mentioned to see how it works.
    Then you can set up the CMS on THAT box!

    Best of luck,
    NiallB


  • Closed Accounts Posts: 34 McGyver


    You could just vmware to build virtual copies of the server....this is a very effective.

    www.vmware.com

    This is not a cheap option...but it is a fast way to work on a development environment.


  • Closed Accounts Posts: 304 ✭✭Zaltais


    Thanks for the great tips guys.

    McGyver, I think VMware would kinda be overkill for this one scenario, as I can't really think of any other instances where I may need it, but thanks for throwing the idea in there. Probably would never have occured to me...

    niallb, basically the rsync option was kinda the road I was thinking of going down alright... so thanks for the tip on --numeric-ids

    The CMS is called Bricolage, and it's a HTML::Mason based CMS.
    HTML::Mason is a mod_perl extension so it's slightly more involved than just worrying about a few cgi's in a directory, but rather about mucking up our Mason / mod_perl install as that's the part that's been highly customised.

    Anyway I'll take a couple of backups, and do an rsync and hopefully everything will go swimmingly and I won't need to restore anything, but if I have any problems, I'll either be back looking for help or begging for a job ;)


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    vmware would certainly be overkill for a test machine,
    but the concept is sound.

    If you had the time you could do something similar using
    user mode linux - basically a linux kernel compiled for the 'linux' platform.
    http://user-mode-linux.sourceforge.net/

    It most commonly runs from a filesystem which is a loopback mounted file. If you have the diskspace, any disasters can be remedied by
    cp oldfilesystem newfilesystem and restarting the linux application (Takes seconds...)
    You can make a filesystem by creating an empty file of the right size.
    (dd if=/dev/zero of=oldfilesystem bs=1048576 count=500 ; mke2fs -F oldfilesystem for a 500M filesystem)
    mount and populate it with something like
    mount -t ext2 -o loop oldfilesystem /mnt/loop
    tar zxvf BACKUPFILE.tar.gz -C /mnt/loop
    umount /mnt/loop


    Good look with bricolage!
    keep us posted.
    NiallB


  • Moderators, Sports Moderators Posts: 8,679 Mod ✭✭✭✭Rew


    Ghost4Unix would do the job, you can just store images of the disks and reload it if it goes tits up

    http://www.feyrer.de/g4u/


  • Advertisement
Advertisement