Migrate ISPConfig/Debian/Drupal to another box ... and keep them in sync.

Discussion in 'Tips/Tricks/Mods' started by tester321, Aug 4, 2010.

  1. tester321

    tester321 Member

    Sorry if you believe I am beating a dead horse by asking this question ... but I have been trying to piece together the best course of action from what I am reading here.

    o I have ISPConfig2 + Drupal6 + Debian Lenny working great ... built from "Perfect Debian Etch + ISPConfig" which I then upgraded Debian and Drupal
    o I have prototyped everything on a virtual machine and currently simply Backup/Restore the entire OS/virtual machine image between two separate virtual machines (two separate locations) i.e. --> same IPs (natted), same everything, but on two different networks. Works GREAT (even though being run on completely different types of hardware!)
    o Now I want (need) to put this config onto a VPS and maintain the virtual machine as a "hot spare" (via DNS failover)/dev/test
    o Among other things, VPS will be on a completely different ("real") IP vs "natted" IP, etc

    o What is the best plan for keeping things "in sync" -- I would REALLY like to avoid MySQL Replication if at all possible!
    o Can I duplicate the config onto the VPS and then tar the whole OS (or just the /var/www, /var/lib/mysql and /etc/..., password+shadow directories) and then only have to change the IP
    o Would ISPConfig2 adjust to changing the one and only IP? Or would I have to reconfigure ISPConfig2 after changing the system IP?

    What is the easiest, most reliable way to get this going?

    Thanks in advance for any hints/suggestions.

    I am SERIOUSLY lamenting not being able to just keep the virtual machines going because they have worked SO well, but I would then be running virtual machine on a virtualized (VPS) environment and, of course, that doesn't make any sense.

    Here is one recent article that I reviewed and another that seemed to almost cover it all
    I have also tried to review most all documents in the "Backup" section, here: http://www.howtoforge.com/howtos/backup
    Last edited: Aug 4, 2010
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    For the files in /var/www, use e.g. rsync. For the databases you can either use mysql replication, a mysql cluster setup or if the database content is not that time critical you can try to dump the mysql database automatically every few minutes and trsnafer this dump to the other server.
  3. tester321

    tester321 Member

    Till, thank you so much for your quick reply. I had seen Falko's response to what seems like a similar question in (this thread) and wondered a few things

    1) Since I won't really have "load balancing", but will have "failover", I don't need syncing every few minutes. In fact, I am willing to absorb the "risk" of only "syncing" once per day ... assuming that my host will be decently reliable.
    2) Why is mysql replication necessary? Is Backing up (i.e., tar or rsync) the mysql databases not a good idea or not technically sufficient? (Even if it requires stopping mysql for the few minutes it would take)
    3) What about the IP address differences between the two ISPConfigs ... even if I sync them, do I still have to make some config change due to the IP difference before the "Secondary" server could go live? I notice you don't appear to suggest syncing the ispconfigs (/root/ispconfig ?) after the initial setup.

    In other words, why not all the steps in this thread, but instead tar the mysql stuff too?

    (Don't beat on me too hard, I just want to know why technically I have to use mysql replication even when I want to only do daily backups)

    Thanks again for your any feedback.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you want to do only dialy backups, then you dont need mysql replication indeed. I thought you wanted to have a failover system with current data.

    Regarding /root/ispconfig replication. This directory does not contain any data that changes after initial ispconfig install, so it has not to be replicated.

    If you do not switch over the ip address to your backup server in case of a failure, you might have to change ip addresses in the website configurations as well.
  5. tester321

    tester321 Member

    Well, of course, I want that like anyone else ... but I am sizing up what is practical vs. what is needed. I have serious doubts about mysql replication (just from reading) ... I guess it is a "don't knock it 'til you try it" scenario


    Huh? Didn't quite get this. The DNS failover switches the hostname to the IP (it checks the site's availability every 5 minutes and switches over to the Backup if it appears the Primary is down).

    BUT, in the proposed scenario, my current server is on, say:
    And the new primary will be on (some real IP at a provider)
    example: 200.139.149.x

    IIRC, even though ISPConfig allows you to put in multiple IPs it actually doesn't have communication or support for multiple servers, right? Will I have to maintain two different ISPConfig setups of all the websites? (Drupal multisites with a bunch of sites on 1 IP using Named-Based Virtual hosting using howtoforge setups)
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You should be aware that you try to setup a ultiserver system with a ispconfig version for single servers. ISPConfig 2 is a controlpanel to be used on single servers, so it has no functions to help you to run it on multiple servers at the same time. For multiservers etups, there is ISPConfig 3 available which supports the configuration mirroring out of the box over two or more servers.
  7. tester321

    tester321 Member

    Is there an upgrade path from ISPConfig2 to ISPConfig3?

    Oh great ... another upgrade :-( lol

    I thought I read in threads that I can't upgrade though (i.e., there is no upgrade path) from ISPConfig2 to 3? i.e., I have to install ISPConfig3 from scratch?

    Can you please confirm for me? Thanks

    So, if no upgrade path, my scenario for the initial setup on ISPConfig3 might be:

    1) Install "Perfect Debian" + ISPConfig3 on new host/primary
    2) Restore /var/www + mysql backups from current ISPConfig2 server
    3) What other major steps?
    Last edited: Aug 4, 2010
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I was not talking about a upgarde. ISPConfig 2 and 3 are completely different software packages with a different system requirements. You can not update from ISPConfig 2 to 3.

    You can not simply restore /var/www as the directory structure and users are different. You will have to restore the website contents of every website to the new website directory on the ispconfig 3 system.

    But you dont have to switch to ISPConfig 3. I just explained you above that you have selected a controlpanel that does not support multiple servers out of the box. You can run a backup system with ispconfig 2 as well, but you might have to do some manual config changes or switch the IP.
  9. tester321

    tester321 Member

    OK, will stick with ISPConfig2

    Till, thanks ... I think the best approach then (to go from a known to a slightly less known) is for me to continue with the current config and maybe do it a slightly different way.

    I have more flexibility with the VM anyway, so I am going to adjust the IP of the VM to match the IP of the VPS provider. I can then using natting (internal to the VM) so it and the host/VPS use the same IP.

    That way I can keep exactly the same OS/config on both and the DNS failover (which occurs external to both networks btw, I am not using DNS on ipsconfig) will just switch hostnames to the appropriate network/machine.

    Internally the OS/settings will be exactly the same -- the VPS will be routing over its true IP, the VM will be routing using that same IP but that IP will be natted internal to the VM and then go out of the physical machine onto the real network/out to the internet.

    (And yes, I will try the mysql replication and other sync suggestions you have made. I want these machines to be exactly the same from the OS perspective).
    Last edited: Aug 4, 2010
  10. tester321

    tester321 Member

    For anyone reading this thread

    I finally bit the bullet and setup MySQL replication and it has been working ok (you can see specifics and links to tweaks in this other thread, here).

    It doesn't remove my need to do what I mention here, but it will give me more time to figure this out before I add additional bandwidth providers.

Share This Page