From: Holger P. <wb...@pa...> - 2007-05-11 00:08:43
|
Hi, Keith Edmunds wrote on 10.05.2007 at 20:55:59 [[BackupPC-users] Import existing files]: > I have a server that has a full backup of a client on it (backup not via > backuppc). I'd like to have that client backup using backuppc, but it is > on a slowish link. that means you want to (ultimately) use either rsync or rsyncd as transport method, because you want to avoid retransfering everything on each full backup. > Is there a way of importing the existing backup files into backuppc? Well, "into BackupPC" would not really help you. You can get any file into the pool by simply backing it up from anywhere (any client, any directory). Once BackupPC_link has processed it (thus putting it in the pool), every future file with the exact same contents will be a link to this pool file. That does not save you the transfer though. > The existing backup is simply a directory tree. If there > isn't, would doing a local backup (server to server) of that directory > tree help, Yes, if and only if you can later trick BackupPC into believing it actually came from your target server. That means you will have to first understand and plan what your future backups will look like. 1.) Decide on a transfer method (rsync or rsyncd?). 2.) Decide which "share names" you are going to use. 3.) Decide which host name you are going to use :). 4.) If you want to keep things simple, set things up locally so that you can access your existing backup tree in the same way, only with another host name (meaning if you intend to back up target:/home/foo with rsync over ssh, you should have ssh access (and sudo if required) to backuphost, where your backup tree is kept under /home/foo, not eg. under /tmp/home/foo, because the path would then be different). 5.) Create your configuration as you will later need it to backup the target host. 6.) Add $Conf{ClientNameAlias} = 'backuphost'; 7.) Run a full backup. This should use the backuphost. 8.) Remove $Conf{ClientNameAlias}. 9.) Run another full backup. This should now use the target host. As the reference backup for rsync(d) is the one made in step 7, only the changes should need to be transfered. It will still take a while, as the block checksums of all files need to be computed on both ends and compared. You should see a lot of disk activity (on both ends) and little network activity (between them). If that isn't possible (or you prefer not keeping things simple), you could try something like 4.) Set things up so that your existing backup tree is accessible under the same path as on the target, but with some path prepended (so /home/foo on the target corresponds to /some/convenient/path/home/foo on the BackupPC server or any other host). 5.) Create a configuration that will put backups in the same place as your target configuration, eg. $Conf{XferMethod} = 'tar'; $Conf{TarShareName} = '/home/foo'; $Conf{TarClientCmd} = '$tarPath -c -v -f - -C /some/convenient/path/$sharename --totals'; (see the comment on tar over NFS in the default config.pl) or possibly even $Conf{XferMethod} = 'rsync'; $Conf{RsyncShareName} = '/home/foo'; $Conf{RsyncClientCmd} = 'sudo chroot /some/convenient/path $rsyncPath $argList'; (providing $rsyncPath and everything needed to execute it exists under /some/convenient/path, and the backuppc user is allowed to 'sudo chroot', which is horribly insecure). Maybe something like $Conf{RsyncClientCmd} = '$rsyncPath --server --sender --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive --ignore-times . /some/convenient/path/home/foo'; could work instead. Be sure to use the same host name you will use later! 6.) You don't need a ClientNameAlias as long as you don't use $host in the command. Note that your real target host will be pinged though to decide whether the backup can be run. 7.) Full backup. 8.) Change your configuration. That might mean setting up a different XferMethod. The ShareName needs to stay the same (even though it might be configured through a different variable ...). 9.) Another full backup (as above). All of that is completely untested. I hope it gives you some ideas to get you started. Please ask if anything is too vague. Regards, Holger |