doc/book/en/annexes/cubicweb-ctl.rst
brancholdstable
changeset 7074 e4580e5f0703
parent 6749 48f468f33704
parent 7073 4ce9e536dd66
child 7078 bad26a22fe29
child 7083 b8e35cde46e9
equal deleted inserted replaced
6749:48f468f33704 7074:e4580e5f0703
     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 Listing available cubes and instance
       
    26 -------------------------------------
       
    27 
       
    28 * ``list``, provides a list of the available configuration, cubes
       
    29   and instances.
       
    30 
       
    31 
       
    32 Creation of a new cube
       
    33 -----------------------
       
    34 
       
    35 Create your new cube cube ::
       
    36 
       
    37    cubicweb-ctl newcube
       
    38 
       
    39 This will create a new cube in
       
    40 ``/path/to/forest/cubicweb/cubes/<mycube>`` for a Mercurial forest
       
    41 installation, or in ``/usr/share/cubicweb/cubes`` for a debian
       
    42 packages installation.
       
    43 
       
    44 Create an instance
       
    45 -------------------
       
    46 
       
    47 You must ensure `~/cubicweb.d/` exists prior to this. On windows, the
       
    48 '~' part will probably expand to 'Documents and Settings/user'.
       
    49 
       
    50 To create an instance from an existing cube, execute the following
       
    51 command ::
       
    52 
       
    53    cubicweb-ctl create <cube_name> <instance_name>
       
    54 
       
    55 This command will create the configuration files of an instance in
       
    56 ``~/etc/cubicweb.d/<instance_name>``.
       
    57 
       
    58 The tool ``cubicweb-ctl`` executes the command ``db-create`` and
       
    59 ``db-init`` when you run ``create`` so that you can complete an
       
    60 instance creation in a single command. But of course it is possible
       
    61 to issue these separate commands separately, at a later stage.
       
    62 
       
    63 Command to create/initialize an instance database
       
    64 -------------------------------------------------
       
    65 
       
    66 * ``db-create``, creates the system database of an instance (tables and
       
    67   extensions only)
       
    68 * ``db-init``, initializes the system database of an instance
       
    69   (schema, groups, users, workflows...)
       
    70 
       
    71 Commands to control instances
       
    72 -----------------------------
       
    73 
       
    74 * ``start``, starts one or more or all instances
       
    75 
       
    76 of special interest::
       
    77 
       
    78   start -D
       
    79 
       
    80 will start in debug mode (under windows, starting without -D will not
       
    81 work; you need instead to setup your instance as a service).
       
    82 
       
    83 * ``stop``, stops one or more or all instances
       
    84 * ``restart``, restarts one or more or all instances
       
    85 * ``status``, returns the status of the instance(s)
       
    86 
       
    87 Commands to maintain instances
       
    88 ------------------------------
       
    89 
       
    90 * ``upgrade``, launches the existing instances migration when a new version
       
    91   of *CubicWeb* or the cubes installed is available
       
    92 * ``shell``, opens a migration shell for manual maintenance of the instance
       
    93 * ``db-dump``, creates a dump of the system database
       
    94 * ``db-restore``, restores a dump of the system database
       
    95 * ``db-check``, checks data integrity of an instance. If the automatic correction
       
    96   is activated, it is recommanded to create a dump before this operation.
       
    97 * ``schema-sync``, synchronizes the persistent schema of an instance with
       
    98   the instance schema. It is recommanded to create a dump before this operation.
       
    99 
       
   100 Commands to maintain i18n catalogs
       
   101 ----------------------------------
       
   102 * ``i18ncubicweb``, regenerates messages catalogs of the *CubicWeb* library
       
   103 * ``i18ncube``, regenerates the messages catalogs of a cube
       
   104 * ``i18ninstance``, recompiles the messages catalogs of an instance.
       
   105   This is automatically done while upgrading.
       
   106 
       
   107 See also chapter :ref:`internationalization`.
       
   108 
       
   109 Other commands
       
   110 --------------
       
   111 * ``delete``, deletes an instance (configuration files and database)
       
   112 
       
   113 Command to create an instance for Google AppEngine datastore source
       
   114 -------------------------------------------------------------------
       
   115 * ``newgapp``, creates the configuration files for an instance
       
   116 
       
   117 This command needs to be followed by the commands responsible for
       
   118 the database initialization. As those are specific to the `datastore`,
       
   119 specific Google AppEgine database, they are not available for now
       
   120 in cubicweb-ctl, but they are available in the instance created.
       
   121 
       
   122 For more details, please see :ref:`GoogleAppEngineSource` .