-
Notifications
You must be signed in to change notification settings - Fork 28
π docs: add comprehensive quickstart guide #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,132 @@ | ||
| .. include:: global.rst.inc | ||
| .. highlight:: bash | ||
| .. _quickstart: | ||
|
|
||
| Quick Start | ||
| =========== | ||
|
|
||
| This chapter will get you started with Borg-Import. | ||
|
|
||
| Prerequisites | ||
| ------------- | ||
|
|
||
| Before using borg-import, you need: | ||
|
|
||
| 1. **BorgBackup installed**: borg-import requires the ``borg`` command to be available in your PATH. | ||
| Install it following the `BorgBackup installation guide <https://borgbackup.readthedocs.io/en/stable/installation.html>`_. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly taken, the user has to use the version selector there and select precisely the version they are using. |
||
|
|
||
| 2. **Python 3.9 or newer**: borg-import is written in Python and requires a modern Python version. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we upgrade the python requirements, it would always need a change here also. Maybe this hint is not needed, I guess pip will also tell if the python requirement is not fulfilled.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that pip will catch unmet Python version requirements. However, I think it's still helpful to keep line 17 as a quick upfront reminder for users reading the quickstart guide, especially those who might not be familiar with Python tooling. It provides a clearer picture of the prerequisites before they even try installing, which can help reduce friction and confusion and save time early on. Also, the Python version requirement doesnβt change regularly, so the maintenance burden for this line should be minimal.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't much "burden", but it can easily happen that this place is overlooked when raising the python requirements and then the docs will differ from the code reality until somebody notices. |
||
|
|
||
| 3. **Sufficient disk space**: Import operations may require temporary space for intermediate processing. | ||
|
|
||
| Basic Usage Pattern | ||
| ------------------- | ||
|
|
||
| All borg-import commands follow this general pattern:: | ||
|
|
||
| borg-import <IMPORTER> [OPTIONS] <SOURCE> <DESTINATION_REPOSITORY> | ||
|
|
||
| Where: | ||
|
|
||
| - ``<IMPORTER>`` is one of: ``borg``, ``rsnapshot``, ``rsynchl``, or ``rsync_tmbackup`` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we add a new importer, this would need fixing. Does borg-import -h give a list of importers? |
||
| - ``<SOURCE>`` is the path to your existing backup directory or repository | ||
| - ``<DESTINATION_REPOSITORY>`` is the BorgBackup repository where archives will be imported | ||
|
|
||
| **Important**: Always use absolute paths or SSH URLs for repositories to avoid issues during import. | ||
|
|
||
| Quick Examples | ||
| -------------- | ||
|
|
||
| **Import from rsnapshot backups**:: | ||
|
|
||
| # Create a new Borg repository first | ||
| borg init --encryption=repokey /path/to/new/borg/repo | ||
|
Comment on lines
+41
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe move this to an own section. |
||
| # Import rsnapshot backups | ||
| borg-import rsnapshot /path/to/rsnapshot/root /path/to/new/borg/repo | ||
|
|
||
| **Import from rsync+hardlinks backups**:: | ||
|
|
||
| # Create a new Borg repository first | ||
| borg init --encryption=repokey /path/to/new/borg/repo | ||
|
Comment on lines
+49
to
+51
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| # Import rsync backups | ||
| borg-import rsynchl /path/to/rsync/backups /path/to/new/borg/repo | ||
|
|
||
| **Import from rsync-time-backup**:: | ||
|
|
||
| # Requires a prefix for archive naming | ||
| borg-import rsync_tmbackup --prefix=mybackup- /path/to/rsync/backups /path/to/new/borg/repo | ||
|
|
||
| **Import from another Borg repository**:: | ||
|
|
||
| # Useful for rebuilding or migrating Borg repositories | ||
| borg-import borg /path/to/old/borg/repo /path/to/new/borg/repo | ||
|
|
||
| Common Options | ||
| -------------- | ||
|
|
||
| **Add prefix to archive names**:: | ||
|
|
||
| borg-import rsnapshot --prefix=imported- /source /destination | ||
|
|
||
| **Pass additional options to borg create**:: | ||
|
|
||
| borg-import rsynchl -o="--compression lz4" /source /destination | ||
|
|
||
| **Debug mode for troubleshooting**:: | ||
|
|
||
| borg-import --debug rsnapshot /source /destination | ||
|
|
||
| How It Works | ||
| ------------ | ||
|
|
||
| borg-import uses a smart approach to preserve Borg's file cache efficiency: | ||
|
|
||
| 1. **Temporary relocation**: Source directories are temporarily moved to a common name (``borg-import-dir``) | ||
| 2. **Archive creation**: Borg creates archives from this temporary location | ||
| 3. **Restoration**: Original directories are moved back to their original locations | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe avoid the word "restoration" here, considering it is usually used in a different meaning when talking about backing up and restoring files... |
||
| 4. **Timestamp preservation**: Original backup timestamps are preserved in Borg archives | ||
|
|
||
| This process ensures that Borg's deduplication and file cache work optimally across imports. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "files cache" (the cache file historically was named just "files") |
||
|
|
||
| Safety Features | ||
| --------------- | ||
|
|
||
| - **Non-destructive**: Original backup structures are preserved | ||
| - **Resume capability**: If interrupted, the process can be safely restarted | ||
| - **Duplicate detection**: Archives already present in the destination are automatically skipped | ||
| - **Journal tracking**: A ``.snapshot`` file tracks the current operation for recovery | ||
|
|
||
| Getting Help | ||
| ------------ | ||
|
|
||
| For detailed help on any importer:: | ||
|
|
||
| borg-import <IMPORTER> -h | ||
|
|
||
| For example:: | ||
|
|
||
| borg-import rsnapshot -h | ||
| borg-import borg -h | ||
|
|
||
| Common Issues | ||
| ------------- | ||
|
|
||
| **"borg command not found"** | ||
| Install BorgBackup first. See the `installation guide <https://borgbackup.readthedocs.io/en/stable/installation.html>`_. | ||
|
|
||
| **"borg-import-dir exists. Cannot continue"** | ||
| A previous import was interrupted. Check the directory and ``.snapshot`` file to understand what happened, then manually clean up if safe to do so. | ||
|
Comment on lines
+118
to
+119
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see that while using borg-import? |
||
|
|
||
| **Permission errors** | ||
| Ensure you have read access to source backups and write access to the destination repository. | ||
|
|
||
| **Out of space** | ||
| Some importers (especially ``borg``) require substantial temporary space. Ensure adequate free space in the working directory. | ||
|
|
||
| Next Steps | ||
| ---------- | ||
|
|
||
| - Read the detailed documentation for your specific backup format | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean? Read the borg docs? The converter always converts to a borg repository. |
||
| - Consider setting up automated backups with your new Borg repository | ||
| - Learn about Borg's powerful features like mounting, pruning, and compression options | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strictly taken, one would think about the desired compression before borg-import-ing into a borg repo and give the respective compression option to borg-import already. Preferably one does not want to use different compression algorithms for borg-import and later for borg. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,7 +45,7 @@ where = ["src"] | |
| [tool.setuptools_scm] | ||
| write_to = "src/borg_import/_version.py" | ||
|
|
||
| [tool.pytest] | ||
| [tool.pytest.ini_options] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this from this PR, it is unrelated. |
||
| python_files = "testsuite/*.py" | ||
| testpaths = ["src"] | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on your PATH?