Hi all,

I've rewritten my FAQ proposition for importing backups.
Please find in attachement my FAQ proposition v0.2 in POD and HTML.

Regards,
--
Toni Van Remortel
[EMAIL PROTECTED]
Title: Importing data in backups


Importing data in backups

This is a technique for importing data from a host you wish to backup with rsync in the future. Doing this will allow you to load your backup with much of the data you will need, thus avoiding transferring it over slow links with rsync.

Prerequisites

Before you can start with the import, make sure you ...

  • ... have the data at hand you want to import. Storage on USB disks, NFS shares or even SMB shares on a local network are some examples. The most important is that you can simulate your target client that you want to backup. So if your client is a Windows server, you should create a simulated Windows server with the correct shares (Samba is very good at it). If you have a client that is backed up through rsync, you need to set up a simulated server with rsync (rsyncd can be used for that). More detailed examples below.

  • ... have enough privileges on the simulation server to perform configuration tasks.

Example 1 : Importing data for a backup with rsync

In this example, we will show you how to import data for a client that you will normally configure using XferMethod 'rsync'.

BackupPC allows you to use 'rsync' or 'rsyncd', both with about the same options. Because the sharenames to backup are in the same configuration option for both transfer methods, we will set up a local, but temporary, rsync server to use as import source.

Step 1: Create or edit /etc/rsyncd.tmp.conf

In this example we will backup /etc, /home, /opt and /var/lib. Our local backup that we like to import, is located in /mnt/usbdisk/client001/ (a mounted USB disk).

So a possible rsyncd.tmp.conf file might look like this:

        hosts allow = 127.0.0.0/8
        uid = root
        gid = root
        use chroot = true
        [/etc/]
                path = /mnt/usbdisk/client001/etc
                read >
        [/home/]
                path = /mnt/usbdisk/client001/home
                read >
        [/opt/]
                path = /mnt/usbdisk/client001/opt
                read >
        [/var/lib/]
                path = /mnt/usbdisk/client001/lib
                read >

We only allow the localhost to access the rsync modules. This is partly for security, and partly for speed.

For each module, there is an additional / at the end of the module name. This is because BackupPC tries to backup the contents of a share (thus rsync demands a / at the end of the sharename).

Step 2: Start rsyncd in a console

The easiest way to run rsyncd temporarily, is by using a console on the backup server. Run this command to start your rsync server:

        rsync --daemon --config=/etc/rsyncd.tmp.conf --no-detach

This will result in an rsync daemon running in the foreground.

Step 3: Configuration of the client in BackupPC

Configure the client in BackupPC. Fill in every configuration detail like it will be for the rest of the backup servers life.

Set the XferMethod to 'rsyncd', set RsyncdAuthRequired to '0' and fill in the correct share names:

        /etc
        /home
        /opt
        /var/lib

As you can see, here we fill in the share names without trailing /.

As last option, fill in the ClientNameAlias:

        127.0.0.1

You can also use the name 'localhost' if you want to. The speed reason for using 'lo', is that it is the fastest network interface on your server, which doesn't interrupt any traffic on eth0, eth1, ... and it allows us to monitor the traffic very easily (as all traffic passes through 'lo', and the only processes doing that are probably ours: BackupPC_dump and rsync).

Step 4: Run a full backup

Open up the clients home page in BackupPC, and hit the Start Full Backup button. BackupPC will now start a full backup through the rsync daemon over the 'lo' interface.

You can monitor the progress by watching the LOG file, and a bandwith monitor (such as 'bmon' or 'iftop') in a console on the backup server.

Step 5: Reconfigure the client

After the backup is done (with success offcourse), change the ClientNameAlias to the real address of the client. Also, change the XferMethod to 'rsync'. Now you can happily run new backups with rsync, and use it's marvelous file transfer techniques.

Example 2 : Importing data for a backup with smb

In this example, we will show you how to import data for a client that you will normally configure using XferMethod 'smb'.

Step 1: Create or edit /etc/samba/smb.conf

In this example we will backup share Profiles and Users, located on a Windows server WINSRV. Our local backup that we like to import, is located in /mnt/usbdisk/WINSRV/ (a mounted USB disk).

So a possible smb.conf file (only the share definitions) might look like this:

        [Profiles]
                comment = This is a temporary share, needed to import backups into the new backup system
                path = /mnt/usbdisk/WINSRV/Profiles
                writable = no
                guest ok = yes
        [Users]
                comment = This is a temporary share, needed to import backups into the new backup system
                path = /mnt/usbdisk/WINSRV/Users
                writable = no
                guest ok = yes

(re)Start samba.

Step 2: Configuration of the client in BackupPC

Configure the client in BackupPC. Fill in every configuration detail like it will be for the rest of the backup servers life.

Set the XferMethod to 'smb' and fill in the correct share names:

        Profiles
        Users

Don't forget SmbShareUserName and SmbSharePasswd. Likely you do not need those, as we specified 'guest ok = yes'.

As last option, fill in the ClientNameAlias with the result of 'hostname' on your temporary samba server.

Step 3: Run a full backup

Open up the clients home page in BackupPC, and hit the Start Full Backup button. BackupPC will now start a full backup over the smb protocol.

You can monitor the progress by watching the LOG file, and a bandwith monitor (such as 'bmon' or 'iftop') in a console on the backup server.

Step 4: Reconfigure the client

After the backup is done (with success offcourse), change the ClientNameAlias to the real address of the client. Don't forget the SmbShareUserName and SmbSharePasswd.

=head1 Importing data in backups

This is a technique for importing data from a host you wish to backup with 
rsync in the future. Doing this will allow you to load your backup with much of 
the data you will need, thus avoiding transferring it over slow links with 
rsync.

=head2 Prerequisites

Before you can start with the import, make sure you ...

=over 4

=item *

... have the data at hand you want to import. Storage on USB disks, NFS shares 
or even SMB shares on a local network are some examples. The most important is 
that you can simulate your target client that you want to backup. So if your 
client is a Windows server, you should create a simulated Windows server with 
the correct shares (Samba is very good at it). If you have a client that is 
backed up through rsync, you need to set up a simulated server with rsync 
(rsyncd can be used for that). More detailed examples below.

=item *

... have enough privileges on the simulation server to perform configuration 
tasks.

=back

=head2 Example 1 : Importing data for a backup with rsync

In this example, we will show you how to import data for a client that you will 
normally configure using XferMethod 'rsync'.

BackupPC allows you to use 'rsync' or 'rsyncd', both with about the same 
options. Because the sharenames to backup are in the same configuration option 
for both transfer methods, we will set up a local, but temporary, rsync server 
to use as import source.

=over 4

=item Step 1: Create or edit /etc/rsyncd.tmp.conf

In this example we will backup /etc, /home, /opt and /var/lib.
Our local backup that we like to import, is located in /mnt/usbdisk/client001/ 
(a mounted USB disk).

So a possible rsyncd.tmp.conf file might look like this:

        hosts allow = 127.0.0.0/8
        uid = root
        gid = root
        use chroot = true

        [/etc/]
                path = /mnt/usbdisk/client001/etc
                read only = true

        [/home/]
                path = /mnt/usbdisk/client001/home
                read only = true

        [/opt/]
                path = /mnt/usbdisk/client001/opt
                read only = true

        [/var/lib/]
                path = /mnt/usbdisk/client001/lib
                read only = true

We only allow the localhost to access the rsync modules. This is partly for 
security, and partly for speed.

For each module, there is an additional / at the end of the module name. This 
is because BackupPC tries to backup the contents of a share (thus rsync demands 
a / at the end of the sharename).

=item Step 2: Start rsyncd in a console

The easiest way to run rsyncd temporarily, is by using a console on the backup 
server.
Run this command to start your rsync server:

        rsync --daemon --config=/etc/rsyncd.tmp.conf --no-detach

This will result in an rsync daemon running in the foreground.

=item Step 3: Configuration of the client in BackupPC

Configure the client in BackupPC. Fill in every configuration detail like it 
will be for the rest of the backup servers life.

Set the XferMethod to 'rsyncd', set RsyncdAuthRequired to '0' and fill in the 
correct share names:

        /etc
        /home
        /opt
        /var/lib

As you can see, here we fill in the share names without trailing /.

As last option, fill in the ClientNameAlias:

        127.0.0.1

You can also use the name 'localhost' if you want to. The speed reason for 
using 'lo', is that it is the fastest network interface on your server, which 
doesn't interrupt any traffic on eth0, eth1, ... and it allows us to monitor 
the traffic very easily (as all traffic passes through 'lo', and the only 
processes doing that are probably ours: BackupPC_dump and rsync).

=item Step 4: Run a full backup

Open up the clients home page in BackupPC, and hit the Start Full Backup 
button. BackupPC will now start a full backup through the rsync daemon over the 
'lo' interface.

You can monitor the progress by watching the LOG file, and a bandwith monitor 
(such as 'bmon' or 'iftop') in a console on the backup server.

=item Step 5: Reconfigure the client

After the backup is done (with success offcourse), change the ClientNameAlias 
to the real address of the client. Also, change the XferMethod to 'rsync'.
Now you can happily run new backups with rsync, and use it's marvelous file 
transfer techniques.

=back

=head2 Example 2 : Importing data for a backup with smb

In this example, we will show you how to import data for a client that you will 
normally configure using XferMethod 'smb'.

=over 4

=item Step 1: Create or edit /etc/samba/smb.conf

In this example we will backup share Profiles and Users, located on a Windows 
server WINSRV.
Our local backup that we like to import, is located in /mnt/usbdisk/WINSRV/ (a 
mounted USB disk).

So a possible smb.conf file (only the share definitions) might look like this:

        [Profiles]
                comment = This is a temporary share, needed to import backups 
into the new backup system
                path = /mnt/usbdisk/WINSRV/Profiles
                writable = no
                guest ok = yes

        [Users]
                comment = This is a temporary share, needed to import backups 
into the new backup system
                path = /mnt/usbdisk/WINSRV/Users
                writable = no
                guest ok = yes

(re)Start samba.

=item Step 2: Configuration of the client in BackupPC

Configure the client in BackupPC. Fill in every configuration detail like it 
will be for the rest of the backup servers life.

Set the XferMethod to 'smb' and fill in the correct share names:

        Profiles
        Users

Don't forget SmbShareUserName and SmbSharePasswd. Likely you do not need those, 
as we specified 'guest ok = yes'.

As last option, fill in the ClientNameAlias with the result of 'hostname' on 
your temporary samba server.       

=item Step 3: Run a full backup

Open up the clients home page in BackupPC, and hit the Start Full Backup 
button. BackupPC will now start a full backup over the smb protocol.

You can monitor the progress by watching the LOG file, and a bandwith monitor 
(such as 'bmon' or 'iftop') in a console on the backup server.

=item Step 4: Reconfigure the client

After the backup is done (with success offcourse), change the ClientNameAlias 
to the real address of the client. Don't forget the SmbShareUserName and 
SmbSharePasswd.

=back
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to