[BlueOnyx:19613] Re: Questions regarding Aventurine Backup/Restore

Michael Stauber mstauber at blueonyx.it
Tue May 24 21:43:48 -05 2016


Hi Dan,

> Is there a procedure for cloning a VPS, either locally or on another
> Aventurine server?

The built in backup allows you to choose between two different forms of
backup: "VZdump" and "rsync". I highly recommend to use "rsync" instead
of "VZdump", as the later one has some issues with larger VPS's.

Regardless if you want to clone an existing VPS, or if you want to copy
a backed up VPS back to active state: The important part is that you use
rsync with all the require switches to make sure that ownerships,
permissions, devices, time stamps and such are all retained and get
copied across.

This is fairly simple, though, and can easily be used by using a method
like this:

rsync -q -ar /source /target


The -q makes it quiet. The switch -ar consists of two individual switches:

-a Archive mode (equal to -rlptgoD)
-r Recursive mode. Already part of -a, but we play it safe.

That will copy the file area of the VPS over. You want to make sure it
ends up under /vz/private/<VPSID>/

Once the file area is there, you also need to copy the VPS config file
over. Either by copying one of another VPS to /etc/vz/conf/<VPSID>.conf,
or by copying the backed up config file of the VPS from the backup. You
find that under /etc/vzdump/vps.conf inside the VPS file area of the
respective VPS.

Make sure to make the needed adjustments in the VPS config such as
hostname and IP.

That's basically it. Once the config and the VPS file area are present,
the new VPS should be visible in the output of "vzlist -a" and you'll be
able to start it with "vzctl start <VPSID>".

The first start will take a long time, as the 2nd level disk quotas need
to be tallied up and stored. If the VPS is a BlueOnyx, then you will
wait this one out. Once the VPS is up, change into the VPS ("vzctl enter
<VPSID>") and then run these two commands to complete the quota
initialization:

/usr/sausalito/sbin/disk_restorequotas.pl
/usr/sbin/swatch

The first one reads the disk quota for Sites and Users from CODB and
writes the quota limits. The 2nd command reads actual quota utilization
and stores that back into CODB.

> Next question.  My Aventurine backup procedure uses Rsync and I know that
> Rsync does not keep the immutable flag bit.   That would mean that files
> like php.ini would not retain this bit during a restore.   Is there a
> procedure to accommodate this?

AFAIK the -ar switch of Rsync does that. If it's just php.ini for suPHP
enabled Vsites, then I wouldn't worry too much about it. It'll
eventually get set again during GUI updates or Vsite changes via the GUI.

> Last question is that during my failed restore attempt, using the
> Aventurine restore feature, the entire backup files were deleted as part of
> the restore process.   This was an unwelcome surprise.

*THAT* should (indeed!) not be the case. The only perhaps possible
explanation: You tried to restore a VPS and the daily cronjob kicked in,
trying to create another backup in between. But even that is a bit odd. :-/

But as said: Both backup and restore use simple RSYNC, so you could
easily do a local (or remote) restore from the CLI.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list