Bacula-users

Re: [Bacula-users] How to properly remove volumes in regards to the catalog?

2016-05-20 01:26:33
Subject: Re: [Bacula-users] How to properly remove volumes in regards to the catalog?
From: Florian Splett <florian.splett AT web DOT de>
To: "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Fri, 20 May 2016 07:25:02 +0200

Hello.

I am sorry, but this is actually not at all, what I want.
I took some time to think about how to explain all this better...

So I have two drives: <LocalDrive> and <ExternalDrive>

I am using a shell script to create a new Volume on <LocalDrive> every month. This script is executed by a bacula job.
<LocalDrive> has run out of space now, so I need to move the existing volumes to <ExternalDrive>, i.e. I do not want to keep the same backups on both drives.

So corresponding to previous replies I got, I created migration jobs and pools / storages for them.
I tried the job for one of my Clients.

Actual Result:
<LocalDrive> still has Volumes <Volume-January>, <Volume-February>, etc.
<ExternalDrive> has 1 single Volume <ExternalVolume>
Catalog references <ExternalVolume>

Desired Result:
<LocalDrive> only has the currently active Volume left: <Volume-May>
<ExternalDrive> has the remaining Volumes in the same structure they were before: <Volume-January>, <Volume-February>, etc.
Catalog references <Volume-January>, <Volume-February>, etc. on <ExternalDrive> and <Volume-May> on <LocalDrive>

So the questions are...
1. In the actual result <LocalDrive> is still full. Can I simply remove the volumes that are no longer referenced by the Catalog?
2. Is there any way for me to achieve the desired result with the job configuration or is an SQL script required?

Again, thank you very much for taking your time to help.

Regards,

Florian S.

Am 19.05.2016 um 16:18 schrieb Wanderlei Huttel:
I understood that you want to keep both backups (default drive 1 year retention and external drive 5 years retention)

I guess the best way is to use Copy Jobs.

Type = Copy 
"Copy is a new type that defines the job that is run as being a Copy Job. A Copy Job is a sort of control job and does not have any Files associated with it, and in that sense they are more or less like an Admin job. Copy jobs simply check to see if there is anything to Copy then possibly start and control new Backup jobs to copy the data from the specified Pool to another Pool. Note that when a copy is made, the original JobIds are left unchanged. The new copies can not be used for restoration unless you specifically choose them by JobId. If you subsequently delete a JobId that has a copy, the copy will be automatically upgraded to a Backup rather than a Copy, and it will subsequently be used for restoration."

I guess this will help you.

Just change "Type = Migration" to "Type = Copy"

Is interesting to use at least 7.0 bacula version because has a lot of improvements


Best Regards

Wanderlei Hüttel

2016-05-19 10:42 GMT-03:00 Florian Splett <florian.splett AT web DOT de>:
Hello.

I see that I did not use "Purge Migration Job = yes", That should explain, while the old volumes still exist fully.

Sorry for the very rough question.
I will try to make the scenario a bit more understandable:

On the hard drive we have on site, a new volume is created every month, starting with a full backup, so that we always need just one volume for any restore process.

I would like to keep this seperation when migrating the volumes to an external drive. I do not know how to do it without creating several jobs though. Each Volume has a different size, so "Maximum Volume Bytes" is not an option.

Here is an example job and pool:

Job {
  Name = "Migrate-WS-003"
  Type = Migrate
  Client = ubuntu_fd
  FileSet = None
  Level = Full
  Messages = Standard
  Storage = Storage_WS-003
  Pool = Pool_WS-003
  Write bootstrap = "/mnt/removableDrive/WS-003/bootstrap_%c.bsr"
  Selection Type = Client
  Selection Pattern = "WS-003_fd"
  Reschedule On Error = no
}

Pool {
  Name = External_WS-003
  Pool Type = Backup
  Recycle = no
  AutoPrune = no
  Volume Retention = 5 year
  Storage = RemovableStorage_WS-003
}

Pool {
  Name = Pool_WS-003
  Pool Type = Backup
  Recycle = no
  AutoPrune = no
  Volume Retention = 1 year
  Label Format = "WS003-Volume"
  Next Pool = External_WS-003
}
Regards,

Florian S.


Am 19.05.2016 um 15:28 schrieb Wanderlei Huttel:
What exactly you want? Your question is not so clear.

If you have 5 old volumes in one pool and you want to move this old volumes to another pool you can use a migration job.

Job{
  Name = "Migration_Job"
  Type = Migrate
  JobDefs = "Backup_Defaults"
  Client  = srv_bacula-fd
  FileSet = "FileSet_SRV_Bacula"
  Pool = "Pool-Old"
  NextPool = "Pool-New"
  Selection Type = SqlQuery
  Selection Pattern = "select distinct JobId from JobMedia where MediaId in (select MediaId from Media where VolumeName like 'Volume-Name-%');"
  Purge Migration Job = yes
  Enabled = no
}


Pool{
  Name = "Pool-Old"
  Pool Type = Backup
  Autoprune = yes
  LabelFormat = "Volume-Name-${NumVols}"
  Maximum Volume Bytes = 10Gb
  Maximum Volumes = 100
  NextPool = "Pool-New"
  Storage = StorageLocal
}


Best Regards

Wanderlei Hüttel

2016-05-19 10:14 GMT-03:00 Florian Splett <florian.splett AT web DOT de>:
Hello, again.

As a quick additional question:
I used to create one volume per month, starting with a full backup. Is
there any way how I can migrate the data to create the exact same
structure?

E.g. 5 old volumes = 5 new volumes

Regards,

Florian S.

Am 19.05.2016 um 14:20 schrieb Florian Splett:
> Hello.
>
> After a lot of preparing the migration of the first set of data with
> migration jobs went smoothly.
> The size matches and when doing a restore the new volume is addressed.
>
> I noticed that the old volumes still exist though.
> Can I remove them now?
> If so: Is the delete option okay (via bat) or should I purge them first?
> I just want to be sure I don't cause any problems.
>
> Regards,
>
> Florian S.
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users