mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-05-29 03:33:59 +08:00
125 lines
3.3 KiB
ReStructuredText
Vendored
125 lines
3.3 KiB
ReStructuredText
Vendored
Backing up and moving Weblate
|
|
=============================
|
|
|
|
Backing up
|
|
----------
|
|
|
|
Depending on what you want to save, back up the type data Weblate stores in each respective place.
|
|
|
|
Database
|
|
~~~~~~~~
|
|
|
|
Where this is located depends on your database setup.
|
|
|
|
The database is the most important storage. Set up regular
|
|
backups of your database, without it all your translation setup will be gone.
|
|
|
|
Files
|
|
~~~~~
|
|
|
|
If you have enough backup space, simply backup the whole :setting:`DATA_DIR`. This
|
|
is safe bet even if it includes some files you don't want.
|
|
The following sections describe in detail what you should back up and what you
|
|
can skip.
|
|
|
|
.. _backup-dumps:
|
|
|
|
Dumped data for backups
|
|
+++++++++++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/backups``.
|
|
|
|
Weblate dumps various data here, and you can include these files for more complete
|
|
backups. The files are updated daily (requires a running Celery beats server, see
|
|
:ref:`celery`). Currently this includes:
|
|
|
|
* Translation memory dump, in JSON format.
|
|
|
|
Version control repositories
|
|
++++++++++++++++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/vcs``.
|
|
|
|
The version control repositories contain a copy of your upstream repositories
|
|
with Weblate changes. If you have push on commit enabled for all your
|
|
translation components, all Weblate changes are included upstream and you
|
|
do not have to backup the repositories on the Weblate side. They can be cloned
|
|
again from the upstream locations with no data loss.
|
|
|
|
SSH and GPG keys
|
|
++++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/ssh`` and :setting:`DATA_DIR` ``/home``.
|
|
|
|
If you are using SSH or GPG keys generated by Weblate, you should back up these
|
|
locations, otherwise you will loose the private keys and you will have to
|
|
regenerate new ones.
|
|
|
|
User uploaded files
|
|
+++++++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/media``.
|
|
|
|
You should back up user uploaded files (e.g. :ref:`screenshots`).
|
|
|
|
Translation memory
|
|
++++++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/memory``.
|
|
|
|
It is recommended to back up this content using
|
|
:djadmin:`dump_memory` in JSON-, instead of binary format, as that
|
|
might eventually change (and is also incompatible going from Python 2 to Python 3).
|
|
Weblate prepares this dump daily, see :ref:`backup-dumps`.
|
|
|
|
Fulltext index
|
|
++++++++++++++
|
|
|
|
Stored in :setting:`DATA_DIR` ``/whoosh``.
|
|
|
|
It is recommended to not backup this and regenerate it from scratch on restore.
|
|
|
|
Celery tasks
|
|
------------
|
|
|
|
The Celery tasks queue might contain some info, but is usually not needed
|
|
for a backup. At most your will loose updates that have not yet ben processed to translation
|
|
memory. It is recommended to perform the fulltext or repository updates upon
|
|
restoring anyhow, so there is no problem in losing these.
|
|
|
|
.. seealso::
|
|
|
|
:ref:`celery`
|
|
|
|
Restoring
|
|
---------
|
|
|
|
1. Restore all data you have backed up.
|
|
|
|
2. Recreate a fulltext index using :djadmin:`rebuild_index`:
|
|
|
|
.. code-block:: sh
|
|
|
|
./manage.py rebuild_index --clean --all
|
|
|
|
3. Restore your :ref:`translation-memory` using :djadmin:`import_memory`.
|
|
|
|
.. code-block:: sh
|
|
|
|
./manage.py import_memory memory.json
|
|
|
|
4. Update all repositories using :djadmin:`updategit`.
|
|
|
|
.. code-block:: sh
|
|
|
|
./manage.py updategit --all
|
|
|
|
Moving a Weblate installation
|
|
------------------------------
|
|
|
|
Relocatable your installation to a different system
|
|
by following the backup and restore instructions above.
|
|
|
|
.. seealso::
|
|
|
|
:ref:`py3`
|