doc/book/en/C013-cubicweb-ctl.en.txt
branchtls-sprint
changeset 1477 b056a49c16dc
parent 1476 f94b41709ce6
parent 1464 09afa1f808c4
child 1480 d3e3d527daf5
child 1481 8ea54e7be3e2
equal deleted inserted replaced
1476:f94b41709ce6 1477:b056a49c16dc
     1 .. -*- coding: utf-8 -*-
       
     2 
       
     3 .. _cubicweb-ctl:
       
     4 
       
     5 ``cubicweb-ctl`` tool
       
     6 =====================
       
     7 
       
     8 `cubicweb-ctl` is the swiss knife to manage `CubicWeb` instances.
       
     9 The general syntax is ::
       
    10 
       
    11   cubicweb-ctl <command> [options command] <arguments commands>
       
    12 
       
    13 To view available commands ::
       
    14 
       
    15   cubicweb-ctl
       
    16   cubicweb-ctl --help
       
    17 
       
    18 Please note that the commands available depends on the `CubicWeb` packages
       
    19 and cubes that have been installed.
       
    20 
       
    21 To view the help menu on specific command ::
       
    22 
       
    23   cubicweb-ctl <command> --help
       
    24 
       
    25 Command to create a cube
       
    26 ------------------------
       
    27 
       
    28 * ``newcube``, create a new cube on the file system based on the name
       
    29   given in the parameters. This command create a cube from an application
       
    30   skeleton that includes default files required for debian packaging.
       
    31   
       
    32 
       
    33 Command to create an instance
       
    34 -----------------------------
       
    35 * ``create``, creates the files for the instance configuration
       
    36 * ``db-create``, creates the system database of an instance (tables and
       
    37   extensions only)
       
    38 * ``db-init``, initializes the system database of an instance
       
    39   (schema, groups, users, workflows...)
       
    40 
       
    41 By default, those three commandes are encapsulated in ``create`` so
       
    42 that they can be executed consecutively.
       
    43 
       
    44 Command to create an instance for Google AppEngine datastore source
       
    45 -------------------------------------------------------------------
       
    46 * ``newgapp``, creates the configuration files for an instance
       
    47 
       
    48 This command needs to be followed by the commands responsible for
       
    49 the database initialization. As those are specific to the `datastore`,
       
    50 specific Google AppEgine database, they are not available for now
       
    51 in cubicweb-ctl, but they are available in the instance created.
       
    52 
       
    53 For more details, please see :ref:`gaecontents` .
       
    54 
       
    55 Commands to launch instance
       
    56 ---------------------------
       
    57 * ``start``, starts one or more or all instances
       
    58 * ``stop``, stops one or more or all instances
       
    59 * ``restart``, restarts one or more or all instances
       
    60 * ``status``, returns the status of the instance
       
    61 
       
    62 Commands to maintain instances
       
    63 ------------------------------
       
    64 * ``upgrade``, launches the existing instances migration when a new version
       
    65   of `CubicWeb` or the cubes installed is available
       
    66 * ``shell``, opens a migration shell for manual maintenance of the instance
       
    67   (see :ref:`cubicweb-ctl-shell` for more details)
       
    68 * ``db-dump``, creates a dump of the system database
       
    69 * ``db-restore``, restores a dump of the system database
       
    70 * ``db-check``, checks data integrity of an instance. If the automatic correction
       
    71   is activated, it is recommanded to create a dump before this operation.
       
    72 * ``schema-sync``, synchronizes the persistent schema of an instance with
       
    73   the application schema. It is recommanded to create a dump before this operation.
       
    74 
       
    75 Commands to maintain i18n catalogs
       
    76 ----------------------------------
       
    77 * ``i18nlibupdate``, regenerates messages catalogs of the `CubicWeb` library
       
    78 * ``i18nupdate``, regenerates the messages catalogs of a cube
       
    79 * ``i18ncompile``, recompiles the messages catalogs of an instance. 
       
    80   This is automatically done while upgrading.
       
    81 
       
    82 Cf :ref:`Internationalisation`.
       
    83 
       
    84 Other commands
       
    85 --------------
       
    86 * ``list``, provides a list of the available configuration, cubes
       
    87   and instances.
       
    88 * ``delete``, deletes an instance (configuration files and database)
       
    89 
       
    90 
       
    91 .. _cubicweb-ctl-shell:
       
    92 
       
    93 ``cubicweb-ctl shell`` addon
       
    94 ----------------------------
       
    95 
       
    96 This migration shell provides an interactive interface to all
       
    97 the migrations functions described in the chapter :ref:`migration`.
       
    98 
       
    99 Usage
       
   100 `````
       
   101 ::
       
   102   
       
   103   ``cubicweb-ctl shell myapp``
       
   104 
       
   105 Examples
       
   106 --------
       
   107 
       
   108 Create an instance from an existing cube
       
   109 ````````````````````````````````````````
       
   110 
       
   111 To create an instance from an existing cube, execute the following
       
   112 command ::
       
   113 
       
   114    cubicweb-ctl create <cube_name> <instance_name>
       
   115 
       
   116 This command will create the configuration files of an instance in
       
   117 ``~/etc/cubicweb.d/<instance_name>``.
       
   118 The tool ``cubicweb-ctl`` allows you to execute the command ``db-create``
       
   119 and ``db-init`` when you run ``create`` so that you can complete an
       
   120 instance creation in a single command.
       
   121 
       
   122 If you decide not to execut those commands while ``cubicweb-ctl create``,
       
   123 then you will have to execute them seperately(``cubicweb-ctl db-create``,
       
   124 ``cubicweb-ctl db-init`` ) otherwise your installation will not be complete
       
   125 and you will not be able to launch your instance.
       
   126 
       
   127 
       
   128 Creation of an instance from a new cube
       
   129 ```````````````````````````````````````
       
   130 
       
   131 Create first your new cube cube ::
       
   132 
       
   133    cubicweb-ctl newcube <mycube>
       
   134 
       
   135 This will create a new cube in ``/path/to/forest/cubicweb/cubes/<mycube>``
       
   136 for a Mercurial forest installation, or in ``/usr/share/cubicweb/cubes``
       
   137 for a debian packages installation, and then create an instance as 
       
   138 explained just above.
       
   139 
       
   140