doc/book/admin/cubicweb-ctl.rst
changeset 10491 c67bcee93248
parent 9917 a98e60464c26
child 11689 213f60272d49
equal deleted inserted replaced
10490:76ab3c71aff2 10491:c67bcee93248
       
     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/grshell-cubicweb/cubes/<mycube>`` for a Mercurial
       
    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 `~/etc/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 (Python based) 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)