Re: Restore backuppc installation (localhost) from existing backuppc backups
[email protected] Tue, 05 May 2026 12:32:24 -0400
| Newsgroups | gmane.comp.sysutils.backup.backuppc.general |
|---|---|
| Message-ID | <[email protected]> |
--===============0735012336660014799== Content-Type: multipart/alternative; boundary=1daaf4bddfdaaae03e729978c72356f71b7f40be --1daaf4bddfdaaae03e729978c72356f71b7f40be Content-Type: text/plain Content-Transfer-Encoding: 7bit Thanks for the detailed reply. I will follow these steps this weekend and see how far I get. On Tue, May 5, 2026, at 12:09 PM, G.W. Haywood wrote: > Hi there, > > On Mon, 4 May 2026, [email protected] wrote: > > > The host running backuppc on my network had its root drive fail. > > :( > > > The actual backup storage was on an external drive which I had > > mounted on /var/lib/backuppc. That external drive is still healthy. > > :) > > > I remember spending a lot of time getting backuppc to work just > > right and dread starting over. > > My early recollections are similar but I wrote it all in my notebook. > It's a habit I developed in my first job - at an explosives research > laboratory in 1971. It's a habit I've kept up ever since, and over > the years it's sometimes been incredibly useful. > > > Since the external drive includes the backup for localhost (the > > former box running backuppc), it should include a backup for > > /etc/backuppc and the config.pl file (I forget which directories I > > set for backup for localhost; hopefully I included /etc). > > Hopefully. Hmmm. > > > It seems there should be a way I can extract my now-lost > > /etc/backuppc/config.pl and other files in that directory. I am > > hoping I can install backuppc fresh, then grab the /etc/backuppc > > files from the external drive, and swap them in. Is this possible? > > Hopefully. If you didn't back up the files, they're probably gone. > > You didn't say what version of BackupPC you're using, so I assume V4. > > First I suggest that you make a copy of your backup drive on another > medium of some sort. Put that copy somewhere safe. Next install a > new version of BackupPC the same way that you installed it originally, > for example if you used a distro package use the same distro package. > At this stage don't try to connect the old backup drive (nor the copy) > but simply get the BackupPC system working. You can use any old host > on the network as a dummy to start making backups. To get you started > set up the configuration to back up one file on it, say every hour or > something like that. > > Once you have the new BackupPC working, shut it down - so that now the > BackupPC script isn't running. Now edit the BackupPC 'hosts' file so > that it contains the hosts that you had on the original system (if you > can't remember them, the hostnames are the names of directories in the > directory .../pc/ of the BackupPC backup data store). > > At this point, if you started BackupPC, it could try to start backing > up your hosts. Presumably you won't want it to do that because you'll > have individual configurations (for example in /etc/backuppc/pc/ [*]) > for each of your hosts, and before starting the backups you'll want to > get those configuratons from a backup. You can do that as follows: > > Replace the 'new' backup store with your 'old' backup store. I'll let > you work out how to do that, from what you've written you're obviously > capable of doing it. When you've done it, you *could* start BackupPC, > but you still don't want to start backups - you still don't have your > old configurations. However, you *can* now use the tools provided by > BackupPC to get files and directories from the backup data store... > > 'BackupPC_ls' lets you list the files in any directory from any backup > of any share of any host. It gives you an md5sum for each file listed. > Here's an example, where I'm logged in as root on the backup server: > > 8<---------------------------------------------------------------------- > > # su -c "/usr/local/BackupPC/bin/BackupPC_ls -h alpha -n 2235 -s Config /" backuppc > /: > -rw-r--r-- 0/0 290 2019-09-26 01:24:33 /.fstab (0416cfcbe01474d6f0526ffa5d890813) > drwxr-xr-x 0/0 0 2020-05-07 15:45:30 /.java/ > -rw------- 0/0 0 2019-09-26 01:05:24 /.pwd.lock (d41d8cd98f00b204e9800998ecf8427e) > drwxr-x--- 0/1002 0 2026-03-26 13:55:12 /BackupPC/ > drwxr-xr-x 0/0 0 2025-02-01 16:36:24 /ImageMagick-6/ > ... > ... > > 8<---------------------------------------------------------------------- > > As you can see, BackupPC_ls (normally) has to be run under the ID of > the backup user, usually 'backuppc' but of course that's configurable. > You give it the host name, in this case 'alpha', the backup number, in > this case 2235, the share name, in this case 'Config', and the name of > the directory that you want to list, in this case '/'. The output is > a bit like that from 'ls -l' but you get md5sums for the files (not > for directories). In my example above I've given the full path to the > BackupPC_ls utility, it will likely be different in your installation. > If you can't remember the share names, they're in the numbered backup > directories under the host name directory with 'f' prefixed to them. > The file 'backups' in the top level of the host's directory shows you > which backup numbers are full and which are incremental. > > 'BackupPC_zcat' then lets you write the content of any file to stdout. > You just give it the md5sum which BackupPC_ls provided for your file. > Below I've recovered the file '.fstab' which has the md5sum '0416cf...': > > 8<---------------------------------------------------------------------- > > # su -c '/usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d890813' backuppc > proc /proc proc defaults 0 0 > PARTUUID=6c586e13-01 /boot vfat defaults 0 2 > PARTUUID=6c586e13-02 / ext4 defaults,noatime 0 1 > PARTUUID=6c586e13-03 /var ext4 defaults,noatime 0 1 > # > > 8<---------------------------------------------------------------------- > > You can redirect stdout to a file of course. That's all there is to it. > > > The names on the files on the external drive are all user-unfriendly. > > A consequence of BackupPC's way of de-duplicating things is that the > files in the backup data store don't have the names that they have on > the backed-up storage devices. The name of a file is the md5sum of > the files's content, with the added wrinkle that the file in the data > store will probably be compressed. The pseudo-filesystems under the > BackupPC host name directories index into the data store using md5sums > as pointers. The pool files are split into 128 subdirectories, each > of which is further split into 128 subdirectories, so that for example > my file '.fstab' 0416cfcbe01474d6f0526ffa5d890813 is stored in > > .../cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 as you can see: > > 8<---------------------------------------------------------------------- > > # ls -l /var/lib/BackupPC/cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 > -r--r--r--. 1 backuppc backuppc 117 Apr 21 14:09 /var/lib/BackupPC/cpool/04/16/0416cfcbe01474d6f0526ffa5d890813 > # > > 8<---------------------------------------------------------------------- > > The file size in the store is only 117 bytes because it's compressed, > if I extract it using BackupPC_zcat I can see the actual file size on > the real storage medium (it was given by the BackupPC_ls output above): > > 8<---------------------------------------------------------------------- > > # su -c '/usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d890813' backuppc | wc -c > 290 > > 8<---------------------------------------------------------------------- > > HTH - and I hope the longer lines didn't wrap on your mail client. > > [*] This would be /etc/BackupPC/pc if you installed from source, so > I'm guessing that you used a distro package e.g. Debian to install. > In my view, their almost universal insistence on e.g. changing the > names and locations of files and directories tends to make things a > lot more difficult for everybody. > > -- > > 73, > Ged. > > > _______________________________________________ > BackupPC-users mailing list > [email protected] > List: https://lists.sourceforge.net/lists/listinfo/backuppc-users > Wiki: https://github.com/backuppc/backuppc/wiki > Project: https://backuppc.github.io/backuppc/ > --1daaf4bddfdaaae03e729978c72356f71b7f40be Content-Type: text/html Content-Transfer-Encoding: quoted-printable <!DOCTYPE html><html><head><title></title></head><body><div style=3D"fon= t-family:Verdana;">Thanks for the detailed reply. I will follow these st= eps this weekend and see how far I get.</div><div style=3D"font-family:V= erdana;"><br></div><div>On Tue, May 5, 2026, at 12:09 PM, G.W. Haywood w= rote:</div><blockquote type=3D"cite" id=3D"qt" style=3D""><div style=3D"= font-family:Verdana;">Hi there,</div><div style=3D"font-family:Verdana;"= ><br></div><div style=3D"font-family:Verdana;">On Mon, 4 May 2026, = <a href=3D"mailto:[email protected]">[email protected]= apmail.org</a> wrote:</div><div style=3D"font-family:Verdana;"><br></div= ><div style=3D"font-family:Verdana;">> The host running backuppc on m= y network had its root drive fail.</div><div style=3D"font-family:Verdan= a;"><br></div><div style=3D"font-family:Verdana;">:(</div><div style=3D"= font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;">>= The actual backup storage was on an external drive which I had</div><di= v style=3D"font-family:Verdana;">> mounted on /var/lib/backuppc. = ; That external drive is still healthy.</div><div style=3D"font-family:V= erdana;"><br></div><div style=3D"font-family:Verdana;">:)</div><div styl= e=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;"= >> I remember spending a lot of time getting backuppc to work just</d= iv><div style=3D"font-family:Verdana;">> right and dread starting ove= r.</div><div style=3D"font-family:Verdana;"><br></div><div style=3D"font= -family:Verdana;">My early recollections are similar but I wrote it all = in my notebook.</div><div style=3D"font-family:Verdana;">It's a habit I = developed in my first job - at an explosives research</div><div style=3D= "font-family:Verdana;">laboratory in 1971. It's a habit I've kept = up ever since, and over</div><div style=3D"font-family:Verdana;">the yea= rs it's sometimes been incredibly useful.</div><div style=3D"font-family= :Verdana;"><br></div><div style=3D"font-family:Verdana;">> Since the = external drive includes the backup for localhost (the</div><div style=3D= "font-family:Verdana;">> former box running backuppc), it should incl= ude a backup for</div><div style=3D"font-family:Verdana;">> /etc/back= uppc and the <a href=3D"http://config.pl">config.pl</a> file (I for= get which directories I</div><div style=3D"font-family:Verdana;">> se= t for backup for localhost; hopefully I included /etc).</div><div style=3D= "font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;">Hop= efully. Hmmm.</div><div style=3D"font-family:Verdana;"><br></div><= div style=3D"font-family:Verdana;">> It seems there should be a way I= can extract my now-lost</div><div style=3D"font-family:Verdana;">> /= etc/backuppc/config.pl and other files in that directory. I am</di= v><div style=3D"font-family:Verdana;">> hoping I can install backuppc= fresh, then grab the /etc/backuppc</div><div style=3D"font-family:Verda= na;">> files from the external drive, and swap them in. Is this= possible?</div><div style=3D"font-family:Verdana;"><br></div><div style= =3D"font-family:Verdana;">Hopefully. If you didn't back up the fil= es, they're probably gone.</div><div style=3D"font-family:Verdana;"><br>= </div><div style=3D"font-family:Verdana;">You didn't say what version of= BackupPC you're using, so I assume V4.</div><div style=3D"font-family:V= erdana;"><br></div><div style=3D"font-family:Verdana;">First I suggest t= hat you make a copy of your backup drive on another</div><div style=3D"f= ont-family:Verdana;">medium of some sort. Put that copy somewhere = safe. Next install a</div><div style=3D"font-family:Verdana;">new = version of BackupPC the same way that you installed it originally,</div>= <div style=3D"font-family:Verdana;">for example if you used a distro pac= kage use the same distro package.</div><div style=3D"font-family:Verdana= ;">At this stage don't try to connect the old backup drive (nor the copy= )</div><div style=3D"font-family:Verdana;">but simply get the BackupPC s= ystem working. You can use any old host</div><div style=3D"font-fa= mily:Verdana;">on the network as a dummy to start making backups. = To get you started</div><div style=3D"font-family:Verdana;">set up the c= onfiguration to back up one file on it, say every hour or</div><div styl= e=3D"font-family:Verdana;">something like that.</div><div style=3D"font-= family:Verdana;"><br></div><div style=3D"font-family:Verdana;">Once you = have the new BackupPC working, shut it down - so that now the</div><div = style=3D"font-family:Verdana;">BackupPC script isn't running. Now = edit the BackupPC 'hosts' file so</div><div style=3D"font-family:Verdana= ;">that it contains the hosts that you had on the original system (if yo= u</div><div style=3D"font-family:Verdana;">can't remember them, the host= names are the names of directories in the</div><div style=3D"font-family= :Verdana;">directory .../pc/ of the BackupPC backup data store).</div><d= iv style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Ve= rdana;">At this point, if you started BackupPC, it could try to start ba= cking</div><div style=3D"font-family:Verdana;">up your hosts. Pres= umably you won't want it to do that because you'll</div><div style=3D"fo= nt-family:Verdana;">have individual configurations (for example in /etc/= backuppc/pc/ [*])</div><div style=3D"font-family:Verdana;">for each of y= our hosts, and before starting the backups you'll want to</div><div styl= e=3D"font-family:Verdana;">get those configuratons from a backup. = You can do that as follows:</div><div style=3D"font-family:Verdana;"><br= ></div><div style=3D"font-family:Verdana;">Replace the 'new' backup stor= e with your 'old' backup store. I'll let</div><div style=3D"font-f= amily:Verdana;">you work out how to do that, from what you've written yo= u're obviously</div><div style=3D"font-family:Verdana;">capable of doing= it. When you've done it, you *could* start BackupPC,</div><div st= yle=3D"font-family:Verdana;">but you still don't want to start backups -= you still don't have your</div><div style=3D"font-family:Verdana;">old = configurations. However, you *can* now use the tools provided by</= div><div style=3D"font-family:Verdana;">BackupPC to get files and direct= ories from the backup data store...</div><div style=3D"font-family:Verda= na;"><br></div><div style=3D"font-family:Verdana;">'BackupPC_ls' lets yo= u list the files in any directory from any backup</div><div style=3D"fon= t-family:Verdana;">of any share of any host. It gives you an md5su= m for each file listed.</div><div style=3D"font-family:Verdana;">Here's = an example, where I'm logged in as root on the backup server:</div><div = style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verda= na;">8<--------------------------------------------------------------= --------</div><div style=3D"font-family:Verdana;"><br></div><div style=3D= "font-family:Verdana;"># su -c "/usr/local/BackupPC/bin/BackupPC_ls -h a= lpha -n 2235 -s Config /" backuppc</div><div style=3D"font-family:Verdan= a;">/:</div><div style=3D"font-family:Verdana;">-rw-r--r-- &n= bsp; 0/0 290= 2019-09-26 01:24:33 /.fstab (0416cfcbe01474d6f0526ffa5d890813)</d= iv><div style=3D"font-family:Verdana;">drwxr-xr-x  = ; 0/0 = 0 2020-05-07 15:45:30 /.java/</div><div style=3D"font-family:Verda= na;">-rw------- 0/0  = ; 0 2019-09-26 01:05:24 /.pwd.= lock (d41d8cd98f00b204e9800998ecf8427e)</div><div style=3D"font-family:V= erdana;">drwxr-x--- 0/1002 &nbs= p; 0 2026-03-26 13:55:12 /BackupPC/</div><= div style=3D"font-family:Verdana;">drwxr-xr-x &nb= sp; 0/0 0 20= 25-02-01 16:36:24 /ImageMagick-6/</div><div style=3D"font-family:V= erdana;">...</div><div style=3D"font-family:Verdana;">...</div><div styl= e=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;"= >8<------------------------------------------------------------------= ----</div><div style=3D"font-family:Verdana;"><br></div><div style=3D"fo= nt-family:Verdana;">As you can see, BackupPC_ls (normally) has to be run= under the ID of</div><div style=3D"font-family:Verdana;">the backup use= r, usually 'backuppc' but of course that's configurable.</div><div style= =3D"font-family:Verdana;">You give it the host name, in this case 'alpha= ', the backup number, in</div><div style=3D"font-family:Verdana;">this c= ase 2235, the share name, in this case 'Config', and the name of</div><d= iv style=3D"font-family:Verdana;">the directory that you want to list, i= n this case '/'. The output is</div><div style=3D"font-family:Verd= ana;">a bit like that from 'ls -l' but you get md5sums for the files (no= t</div><div style=3D"font-family:Verdana;">for directories). In my= example above I've given the full path to the</div><div style=3D"font-f= amily:Verdana;">BackupPC_ls utility, it will likely be different in your= installation.</div><div style=3D"font-family:Verdana;">If you can't rem= ember the share names, they're in the numbered backup</div><div style=3D= "font-family:Verdana;">directories under the host name directory with 'f= ' prefixed to them.</div><div style=3D"font-family:Verdana;">The file 'b= ackups' in the top level of the host's directory shows you</div><div sty= le=3D"font-family:Verdana;">which backup numbers are full and which are = incremental.</div><div style=3D"font-family:Verdana;"><br></div><div sty= le=3D"font-family:Verdana;">'BackupPC_zcat' then lets you write the cont= ent of any file to stdout.</div><div style=3D"font-family:Verdana;">You = just give it the md5sum which BackupPC_ls provided for your file.</div><= div style=3D"font-family:Verdana;">Below I've recovered the file '.fstab= ' which has the md5sum '0416cf...':</div><div style=3D"font-family:Verda= na;"><br></div><div style=3D"font-family:Verdana;">8<----------------= ------------------------------------------------------</div><div style=3D= "font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;"># s= u -c '/usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d89= 0813' backuppc</div><div style=3D"font-family:Verdana;">proc = /proc = proc = defaults 0 &n= bsp; 0</div><div style=3D"font-family:Verdana;">= PARTUUID=3D6c586e13-01 /boot &n= bsp; vfat defaults = 0 &nbs= p; 2</div><div style=3D"font-family:Verdana;">PARTUUID=3D6c586e13-02&nbs= p; / &n= bsp; ext4 defaults,noatime 0 &n= bsp; 1</div><div style=3D"font-family:Verdana;">= PARTUUID=3D6c586e13-03 /var &nb= sp; ext4 defaults,noatime = ; 0 1</div><div style=3D"font-family= :Verdana;">#</div><div style=3D"font-family:Verdana;"><br></div><div sty= le=3D"font-family:Verdana;">8<---------------------------------------= -------------------------------</div><div style=3D"font-family:Verdana;"= ><br></div><div style=3D"font-family:Verdana;">You can redirect stdout t= o a file of course. That's all there is to it.</div><div style=3D"= font-family:Verdana;"><br></div><div style=3D"font-family:Verdana;">>= The names on the files on the external drive are all user-unfriendly.</= div><div style=3D"font-family:Verdana;"><br></div><div style=3D"font-fam= ily:Verdana;">A consequence of BackupPC's way of de-duplicating things i= s that the</div><div style=3D"font-family:Verdana;">files in the backup = data store don't have the names that they have on</div><div style=3D"fon= t-family:Verdana;">the backed-up storage devices. The name of a fi= le is the md5sum of</div><div style=3D"font-family:Verdana;">the files's= content, with the added wrinkle that the file in the data</div><div sty= le=3D"font-family:Verdana;">store will probably be compressed. The= pseudo-filesystems under the</div><div style=3D"font-family:Verdana;">B= ackupPC host name directories index into the data store using md5sums</d= iv><div style=3D"font-family:Verdana;">as pointers. The pool files= are split into 128 subdirectories, each</div><div style=3D"font-family:= Verdana;">of which is further split into 128 subdirectories, so that for= example</div><div style=3D"font-family:Verdana;">my file '.fstab' 0416c= fcbe01474d6f0526ffa5d890813 is stored in</div><div style=3D"font-family:= Verdana;"><br></div><div style=3D"font-family:Verdana;">.../cpool/04/16/= 0416cfcbe01474d6f0526ffa5d890813 as you can see:</div><div style=3D"font= -family:Verdana;"><br></div><div style=3D"font-family:Verdana;">8<---= -------------------------------------------------------------------</div= ><div style=3D"font-family:Verdana;"><br></div><div style=3D"font-family= :Verdana;"># ls -l /var/lib/BackupPC/cpool/04/16/0416cfcbe01474d6f0526ff= a5d890813</div><div style=3D"font-family:Verdana;">-r--r--r--. 1 backupp= c backuppc 117 Apr 21 14:09 /var/lib/BackupPC/cpool/04/16/0416cfcbe01474= d6f0526ffa5d890813</div><div style=3D"font-family:Verdana;">#</div><div = style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verda= na;">8<--------------------------------------------------------------= --------</div><div style=3D"font-family:Verdana;"><br></div><div style=3D= "font-family:Verdana;">The file size in the store is only 117 bytes beca= use it's compressed,</div><div style=3D"font-family:Verdana;">if I extra= ct it using BackupPC_zcat I can see the actual file size on</div><div st= yle=3D"font-family:Verdana;">the real storage medium (it was given by th= e BackupPC_ls output above):</div><div style=3D"font-family:Verdana;"><b= r></div><div style=3D"font-family:Verdana;">8<-----------------------= -----------------------------------------------</div><div style=3D"font-= family:Verdana;"><br></div><div style=3D"font-family:Verdana;"># su -c '= /usr/local/BackupPC/bin/BackupPC_zcat 0416cfcbe01474d6f0526ffa5d890813' = backuppc | wc -c</div><div style=3D"font-family:Verdana;">290</div><div = style=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verda= na;">8<--------------------------------------------------------------= --------</div><div style=3D"font-family:Verdana;"><br></div><div style=3D= "font-family:Verdana;">HTH - and I hope the longer lines didn't wrap on = your mail client.</div><div style=3D"font-family:Verdana;"><br></div><di= v style=3D"font-family:Verdana;">[*] This would be /etc/BackupPC/pc if y= ou installed from source, so</div><div style=3D"font-family:Verdana;">I'= m guessing that you used a distro package e.g. Debian to install.</div><= div style=3D"font-family:Verdana;">In my view, their almost universal in= sistence on e.g. changing the</div><div style=3D"font-family:Verdana;">n= ames and locations of files and directories tends to make things a</div>= <div style=3D"font-family:Verdana;">lot more difficult for everybody.</d= iv><div style=3D"font-family:Verdana;"><br></div><div style=3D"font-fami= ly:Verdana;">-- </div><div style=3D"font-family:Verdana;"><br></div= ><div style=3D"font-family:Verdana;">73,</div><div style=3D"font-family:= Verdana;">Ged.</div><div style=3D"font-family:Verdana;"><br></div><div s= tyle=3D"font-family:Verdana;"><br></div><div style=3D"font-family:Verdan= a;">_______________________________________________</div><div style=3D"f= ont-family:Verdana;">BackupPC-users mailing list</div><div style=3D"font= -family:Verdana;"><a href=3D"mailto:[email protected]= ">[email protected]</a></div><div style=3D"font-famil= y:Verdana;">List: <a href=3D"https://lists.source= forge.net/lists/listinfo/backuppc-users">https://lists.sourceforge.net/l= ists/listinfo/backuppc-users</a></div><div style=3D"font-family:Verdana;= ">Wiki: <a href=3D"https://github.com/backuppc/ba= ckuppc/wiki">https://github.com/backuppc/backuppc/wiki</a></div><div sty= le=3D"font-family:Verdana;">Project: <a href=3D"https://backuppc.gi= thub.io/backuppc/">https://backuppc.github.io/backuppc/</a></div><div st= yle=3D"font-family:Verdana;"><br></div></blockquote><div style=3D"font-f= amily:Verdana;"><br></div></body></html> --1daaf4bddfdaaae03e729978c72356f71b7f40be-- --===============0735012336660014799== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0735012336660014799== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ BackupPC-users mailing list [email protected] List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: https://github.com/backuppc/backuppc/wiki Project: https://backuppc.github.io/backuppc/ --===============0735012336660014799==--