Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Adds docs for re-using files on disk when DB is lost #2708

Merged
merged 1 commit into from Aug 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/user-guide/deferred-download.rst
Expand Up @@ -326,6 +326,41 @@ downloading.
access to both the Content Sources configuration directory and the ``file://`` URL.


Re-Using Files On Disk When DB Is Lost
--------------------------------------

Given a situation where the database has been lost, but the files within
``/var/lib/pulp/content/`` are still present, it is possible to re-use those
files when creating new repositories by using Pulp's deferred download
functionality. For each repository that needs to be recreated, follow the steps
below.

.. note::
This strategy only works for plugins that support the deferred download
functionality.

#. Create the new repository with a download policy of ``on_demand``.

#. Sync the new repository. This will populate the database with knowledge
of each remote piece of content without actually downloading the files.

#. Run the download_repo task with the ``verify_all_units`` option set to
``True``. This will check the filesystem for existing files and verify
their integrity, only downloading a file from the remote source if it is not
found on disk. From the command line::

pulp-admin repo download --repo-id=myrepo --verify-all

#. Change the download policy of the repository to whichever policy you
want to use long-term.

.. note::
There is a `known issue <https://pulp.plan.io/issues/2177>`_ that will
prevent the units from having their ``downloaded`` attribute from being set
to ``True``. That may not matter unless you depend on that attribute being
correct.


Troubleshooting
---------------

Expand Down