doc/book/en/admin/migration.rst
branchstable
changeset 5371 6d25b84ffd50
child 10235 684215aca046
equal deleted inserted replaced
5370:dc6f3247bfc2 5371:6d25b84ffd50
       
     1 .. -*- coding: utf-8 -*-
       
     2 
       
     3 Migrating cubicweb instances - benefits from a distributed architecture
       
     4 =======================================================================
       
     5 
       
     6 Migrate apache & cubicweb
       
     7 -------------------------
       
     8 
       
     9 **Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime.
       
    10 
       
    11 **Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host. You are not migrating your pyro server. You are not using multisource (more documentation on that soon).
       
    12 
       
    13 **Steps** :
       
    14 
       
    15 1. *on new machine* : install your environment (*pseudocode*) ::
       
    16 
       
    17      apt-get install cubicweb cubicweb-applications apache2
       
    18 
       
    19 2. *on old machine* : copy your cubicweb and apache configuration to the new machine ::
       
    20 
       
    21     scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/
       
    22     scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/
       
    23 
       
    24 3. *on new machine* : give new ids to pyro registration so the new instances can register ::
       
    25 
       
    26      cd /etc/cubicweb.d/ ; sed -i.bck 's/^pyro-instance-id=.*$/\02/' */all-in-one.conf
       
    27 
       
    28 4. *on new machine* : start your instances ::
       
    29 
       
    30      cubicweb start
       
    31 
       
    32 5. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
       
    33 
       
    34 6. change dns entry from your oldmachine to newmachine
       
    35 
       
    36 7. shutdown your *old machine* (if it doesn't host other services or your database)
       
    37 
       
    38 8. That's it.
       
    39 
       
    40 **Possible enhancements** : use right from the start a pound server behind your apache, that way you can add backends and smoothily migrate by shuting down backends that pound will take into account.
       
    41 
       
    42 Migrate apache & cubicweb with pyro
       
    43 -----------------------------------
       
    44 
       
    45 FIXME TODO
       
    46