doc/book/en/admin/migration.rst
changeset 10235 684215aca046
parent 5371 6d25b84ffd50
equal deleted inserted replaced
10232:cda1bdc3652e 10235:684215aca046
     6 Migrate apache & cubicweb
     6 Migrate apache & cubicweb
     7 -------------------------
     7 -------------------------
     8 
     8 
     9 **Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime.
     9 **Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime.
    10 
    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).
    11 **Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host.
    12 
    12 
    13 **Steps** :
    13 **Steps** :
    14 
    14 
    15 1. *on new machine* : install your environment (*pseudocode*) ::
    15 1. *on new machine* : install your environment (*pseudocode*) ::
    16 
    16 
    19 2. *on old machine* : copy your cubicweb and apache configuration to the new machine ::
    19 2. *on old machine* : copy your cubicweb and apache configuration to the new machine ::
    20 
    20 
    21     scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/
    21     scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/
    22     scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/
    22     scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/
    23 
    23 
    24 3. *on new machine* : give new ids to pyro registration so the new instances can register ::
    24 3. *on new machine* : start your instances ::
    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 
    25 
    30      cubicweb start
    26      cubicweb start
    31 
    27 
    32 5. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
    28 4. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
    33 
    29 
    34 6. change dns entry from your oldmachine to newmachine
    30 5. change dns entry from your oldmachine to newmachine
    35 
    31 
    36 7. shutdown your *old machine* (if it doesn't host other services or your database)
    32 6. shutdown your *old machine* (if it doesn't host other services or your database)
    37 
    33 
    38 8. That's it.
    34 7. That's it.
    39 
    35 
    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.
    36 **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 
    37 
    42 Migrate apache & cubicweb with pyro
       
    43 -----------------------------------
       
    44 
    38 
    45 FIXME TODO
       
    46