forked from fedora-copr/copr
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: simplified steps for upgrading to Fedora N+2
- Loading branch information
Showing
3 changed files
with
224 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,50 @@ | ||
.. _database_backup: | ||
|
||
Database backup | ||
=============== | ||
Database backups | ||
================ | ||
|
||
We periodically create a databse dump and offer users to download | ||
it. At the same time, it can be used as a database backup if something | ||
wrong happens. Please see ``/etc/cron.d/cron-backup-database-coprdb``. | ||
We periodically create two kinds of database dumps. | ||
|
||
To backup the database manually (this can be useful e.g. before | ||
upgrading to a new major version of PostgreSQL), run:: | ||
Private/backup dump | ||
------------------- | ||
|
||
This "complete" dump is done for potential disaster-recovery situations. It | ||
contains all the data (including private stuff like API tokens), and therefore | ||
we **never publish it or download it onto our machines**. The dump is created in | ||
the ``/backups/`` directory on Copr Frontend, and it is periodically pulled by | ||
a rdiff-backup Fedora Infrastructure bot `configured by Ansible | ||
<https://pagure.io/fedora-infra/ansible/blob/main/f/playbooks/rdiff-backup.yml>`_. | ||
|
||
To generate the backup manually (this can be useful e.g. before upgrading to a | ||
new major version of PostgreSQL), run:: | ||
|
||
[root@copr-fe ~][PROD]# su - postgres | ||
bash-5.0$ /usr/local/bin/backup-database coprdb | ||
|
||
Please be aware that the script does ``sleep`` for some | ||
undeterministic amount of time. You might want to kill the ``sleep`` | ||
process to speed it up a little. | ||
.. warning:: | ||
|
||
Please be aware that the script does an initial ``sleep`` for some | ||
undeterministic amount of time (to not backup all the Fedora Infra databases | ||
at the same time). You might want to kill the ``sleep`` process to speed it | ||
up a little. Still, be prepared that the dump, mostly because of the XZ | ||
compression, takes more than 20 minutes! | ||
|
||
.. warning:: | ||
|
||
If you run this manually to have the :ref:`last-minute pre-upgrade dump | ||
<how_to_upgrade_persistent_instances>`, you need to **keep the machine | ||
running** till the upgrade is done — to keep the ``/backups`` directory | ||
existing! | ||
|
||
Public dumps | ||
------------ | ||
|
||
These dumps are `publicly available | ||
<https://copr.fedorainfracloud.org/db_dumps/>`_ for anyone's experiments. | ||
These are generated overnight via:: | ||
|
||
/etc/cron.d/cron-backup-database-coprdb | ||
|
||
Those dumps have all the private data filtered out (namely the contents of | ||
``_private`` tables), but still usable as-is for debugging purposes (e.g. | ||
spawning a dtesting Copr Frontend container with pre-generated database). |
Oops, something went wrong.