2014-09-18 09:32:28 +02:00
|
|
|
.. _topics-setup-database:
|
2014-09-13 12:19:20 +02:00
|
|
|
|
|
|
|
|
=======================
|
|
|
|
|
How to setup a database
|
|
|
|
|
=======================
|
|
|
|
|
|
2015-05-06 12:52:15 +02:00
|
|
|
The database section of the :ref:`configuration <topics-configuration>` must be
|
|
|
|
|
set before starting.
|
2014-09-13 12:19:20 +02:00
|
|
|
|
|
|
|
|
Create a database
|
|
|
|
|
=================
|
|
|
|
|
|
|
|
|
|
Depending of the database backend choosen, you must create a database (see the
|
2020-11-29 11:35:29 +00:00
|
|
|
documentation of the choosen backend). The user running ``trytond`` must be
|
2014-09-13 12:19:20 +02:00
|
|
|
granted the priviledge to create tables. For backend that has the option, the
|
2020-11-29 11:35:29 +00:00
|
|
|
encoding of the database must be set to ``UTF-8``.
|
2014-09-13 12:19:20 +02:00
|
|
|
|
|
|
|
|
Initialize a database
|
|
|
|
|
=====================
|
|
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
A database can be initialized using this command line:
|
2014-09-13 12:19:20 +02:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ trytond-admin -c <config file> -d <database name> --all
|
2014-09-13 12:19:20 +02:00
|
|
|
|
2020-11-29 11:35:29 +00:00
|
|
|
At the end of the process, ``trytond-admin`` will ask to set the password for
|
|
|
|
|
the ``admin`` user.
|
2016-12-19 10:05:48 +01:00
|
|
|
|
|
|
|
|
Update a database
|
|
|
|
|
=================
|
|
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
To upgrade to a new series, the command line is:
|
2016-12-19 10:05:48 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ trytond-admin -c <config file> -d <database name> --all
|
2016-12-19 10:05:48 +01:00
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
Prior to upgrade see if there is no manual action to take on the `migration
|
|
|
|
|
topic`_.
|
|
|
|
|
|
|
|
|
|
.. _`migration topic`: https://discuss.tryton.org/c/migration
|
|
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
To activate a new language on an existing database, the command line is:
|
2016-12-19 10:05:48 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ trytond-admin -c <config file> -d <database name> --all -l <language code>
|
2016-12-19 10:05:48 +01:00
|
|
|
|
|
|
|
|
Once activated, the language appears in the user preferences.
|
2017-11-22 23:48:35 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
When installing new modules, the list of modules must be updated with:
|
2017-11-22 23:48:35 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
.. code-block:: console
|
2017-11-22 23:48:35 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
$ trytond-admin -c <config file> -d <database name> --update-modules-list
|
2017-11-22 23:48:35 +01:00
|
|
|
|
2022-03-27 16:06:09 +02:00
|
|
|
Once updated, the new modules can be activated from the client or activated with:
|
|
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
|
|
$ trytond-admin -c <config file> -d <database name> -u <module name> --activate-dependencies
|