[Borgbackup] Is it possible to encrypt and existing unencrypted borg repository?

Bzzzz lazyvirus at gmx.com
Fri Apr 3 15:52:52 EDT 2020


On Fri, 3 Apr 2020 20:15:01 +0100
Advrk Aplmrkt <avkaplmkt at gmail.com> wrote:

[I put it back in the loop, as "reply to ML" only took your own e-mail
address in account :(]

> Thank you!
> 
> Can you clarify the step " use mc to copy from unencrypted mount to
> new repo"?
> 
> I can't find the `mc` command in my terminal (would `cp` work?).  

! I made a mistake, you don't copy, you have to use the BB client to
read the mounted old backup in order to make a new backup, encrypted
this time !

> Also,
> did you mean I mount the old backup somewhere, and ask borg to back up
> the mounted files into the new, encrypted repo?  

Yep


> If so, this will probably work to achieve most of my goals, but doing
> it this way means the *history* of all of my backups will not be
> migrated unless I manually mount each backup in the old repository and
> back it up into the new one? Sounds tedious considering I have a lot
> of backups in the old repo!  

Actually, I don't see any other way to do that other than the one I told
you about (erratum included !) - if there is/are really other ways, may
be some others will kick in !?

On the other hand, as you can list old backups, it is trivial to build a
script that'll automatize the whole process, write it, check it, fire it
and do something else (drinking a beer while eating a pizza on top of
your keyboard is a must for somebody working in IT or you can scratch you
legs to get red stockings 😋)

Oh, and may be you do not need to keep so many backups, I mean if you
have more than one old backup per machine, may be keeping only the last
one would do, think twice !

Jean-Yves

> On 02/04/2020, Bzzzz <lazyvirus at gmx.com> wrote:  
> > On Thu, 2 Apr 2020 20:03:18 +0100
> > Advrk Aplmrkt <avkaplmkt at gmail.com> wrote:
> >  
> >> Hello,  
> >
> > Hi
> >  
> >> I have an old borg repository (last used with version 1.1.10) that
> >> doesn't have encryption. I would like to keep the archives in this
> >> repository, but I'd prefer to "upgrade" the repository so that is
> >> uses encryption. Can this be done? If so, how? If not, is there
> >> anyway to migrate the data in this repository to a new one that has
> >> encryption?
> >>
> >> From what I can tell, encryption is applied at the very beginning
> >> when using the `borg init` command. But is there a way around this?
> >> Sorry if I missed something obvious in the documentation, if so
> >> please correct me. Thank you very much.  
> >
> > I'd say the fastest would be:
> >
> > * create a new & encrypted repo
> >
> > * borg mount old_backup::backup#1 /somewhere
> >
> > * use mc to copy from unencrypted mount to new repo
> >
> > * borg mount new_backup::backup#1 /other_place
> >
> > * randomly test if everything's right
> > 	cmp /somewhere/path/file1 /other_place/path/file1
> >
> > * iterate N times where N=Nb_backups
> >
> > All operations one the server machine, of course.
> >
> > Jean-Yves  



More information about the Borgbackup mailing list