Extracting archives to remote pc #494
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#494
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Hello there, I wanted to extract archives to remote pc. I couldn't find in documentation of borgmatic extract. Is it possible to set remote path using --destination flag? Thanks
Steps to reproduce (if a bug)
Not a bug
Actual behavior (if a bug)
Not a bug
Expected behavior (if a bug)
Not a bug
Other notes / implementation ideas
Environment
borgmatic version: [1.5.21]
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: [Fedora package]
Borg version: [1.1.17]
Use
sudo borg --version
Python version: [3.10.2]
Use
python3 --version
Database version (if applicable): [13.4]
Use
psql --version
ormysql --version
on client and server.operating system and version: [Fedora Server 35]
Unfortunately, it's not currently possible to use a remote
--destination
withborgmatic extract
. Only local paths will work there.One work-around could be if you first mounted a remote filesystem so as to appear local, e.g. using NFS or SMB. In that case, you could
borgmatic extact --destination
directly to that local mount point.Ok thank you so much I've done it using sftp. Before closing this issue, I just wanted to be clear about restoring db. does borgmatic restore --archive archivename command works just like
or does it extract the database dump to current directory thanks.
borgmatic restore
actually streams the database restore directly from Borg topsql
orpg_restore
. That way it never needs to take up space in a temporary file.ow ok I was almost replaced my current database if that so, but in my case I am storing my backups to remote pc, how can I restore my db to another remote pc then?
am sorry for raising unrelated topic
Two options:
Thanks for your reply:
for option one: I have already configured hostname: localhost because am backup up my database from my local machine where I have installed borgmatic and borg. I am little bit confused so take look at my structure here and can you please explain to me how can I restore pg db, am sorry for taking your time.
Would it be possible for you to run
borgmatic extract
andborgmatic restore
on S1 with the "localhost" database configuration and a remote Borg repository (P2)? Then it would install your files and database to S1.That works exactly as I wanted amazing @witten!
I didn't know that I could run borgmatic extract/restore commands on other machines if I have got config.yaml config file. Well what can I say, Thank you so much!
And just little bit as a suggestion I would like such tips to be included on borgmatic docs, it might be useful for someone like me.
Glad to hear that works out for you!
I have a very similar use case (Backup a remote server and extract those files/DBs on a local PC).
@elhananjair / @witten would you mind sharing some details about the borgmatic configuration files?
I guess I would need to copy the borgmatic/config.yaml from the remote server to my local PC - but then remove the
location
:source_directories
lines from it? Because I do not want to backup any files/directories on the local PC, but only do a extract/restore there.Is that correct?
Yes, that sounds like it should work! Although you wouldn't even have to remove the
source_directories
if you only ever run anextract
/restore
from that local PC.source_directories
is only used oncreate
.Seems to work. Indeed I get an error without having source_directories:
Though, I would prefer to not have those in my
config.yaml
to avoid running accidenticallycreate
on the local PC and overriding the backup.Thanks for maintaining borgmatic :-)
Sure thing!
source_directories
is required.. but its value can be an empty list. See #364 for an example!Uh, great, thanks for pointing me to #364. Well, as @elhananjair already said in #494 (comment) the use case of having one machine that does backups and then a totally other machine only used for extracts or checks or local restores might deserve an Howto within the documentation.
(Or I did not find it, though, I even also searched the issuee tracker too)
Please ignore if you disagree :-)
Thanks again.