Hi Stefano

The old backups (volumes) are in storage_good or storage_bad ? If they are
in the old place (storage_bad), you need to recreate the old storage in
bacula.

If they are in storage_good you can alter database and change StorageId of
table Media to set the Storaged of old BackupsI did a test and it worked.


# Query to get storage id
select StorageId, Name from Storage;

# Query to get MediaId from a Specifics Jobs  / (X1, X2, X3 are the numbers
of JobId's)
select distinct MediaId from JobMedia where JobId in (X1, X2, X2);

# Query to get update StorageId on table Media / XXX is the number of
StorageId (X1, X2, X3 are the numbers of JobId's)
update Media set
StorageId = XXX
where MediaId in ( select distinct MediaId from JobMedia where JobId in
(X1, X2, X2)  );


Best Regards Wanderlei


2015-11-23 17:45 GMT-02:00 stefano scotti <scottistefan...@gmail.com>:

> Hello everyone,
>
> im using bacula 5.2, i hope it isnt too old for you to give me an answer.
>
> the problem is this:
>
> when i try to restore from a job which refers to a storage named
> "storage_good", it returns an error saying that the task cannot be
> performed, because storage resource cannot be found... but this storage
> resource is not right, it is an old storage that has nothing to do with the
> job. it is named "storage_bad".
>
> this "storage_bad" was deleted some weeks ago cause i didnt need it
> anymore.
>
> this is the error:
>
> 23-nov 19:59 mydir-dir JobId 1988: Start Restore Job
> RestoreFiles.2015-11-23_19.59.23_06
> 23-nov 19:59 mydir-dir JobId 1988: Using Device "good_device"
> 23-nov 19:59 mydir-dir JobId 1988: Warning: Could not get storage resource
> 'bad_storage'.
> 23-nov 19:59 mydir-sd JobId 1988: Fatal error: No Volume names found for
> restore.
> 23-nov 19:59 mydir-fd JobId 1988: Fatal error: job.c:2390 Bad response to
> Read Data command. Wanted 3000 OK data
> , got 3000 error
>
> 23-nov 19:59 mydir-dir JobId 1988: Fatal error: Could not get storage
> resource 'bad_storage'.
> 23-nov 19:59 mydir-dir JobId 1988: Error: Bacula mydir-dir 5.2.6 (21Feb12):
> Build OS:               x86_64-pc-linux-gnu debian 7.0
> JobId:                  1988
> Job:                    RestoreFiles.2015-11-23_19.59.23_06
> Restore Client:         mydir-fd
> Start time:             23-nov-2015 19:59:25
> End time:               23-nov-2015 19:59:25
> Files Expected:         7
> Files Restored:         0
> Bytes Restored:         0
> Rate:                   0.0 KB/s
> FD Errors:              1
> FD termination status:
> SD termination status:  Error
> Termination:            *** Restore Error ***
>
> 23-nov 19:59 mydir-dir JobId 1988: Error: Bacula mydir-dir 5.2.6 (21Feb12):
> Build OS:               x86_64-pc-linux-gnu debian 7.0
> JobId:                  1988
> Job:                    RestoreFiles.2015-11-23_19.59.23_06
> Restore Client:         mydir-fd
> Start time:             23-nov-2015 19:59:25
> End time:               23-nov-2015 19:59:25
> Files Expected:         7
> Files Restored:         0
> Bytes Restored:         0
> Rate:                   0.0 KB/s
> FD Errors:              2
> FD termination status:
> SD termination status:  Error
> Termination:            *** Restore Error ***
>
>
> this is the pool-job-storage configuration:
>
> Pool {
>   Name = good_pool_full
>   Pool Type = Backup
>   Recycle = yes
>   AutoPrune = yes
>   Volume Retention = 1 year
>   Volume Use Duration = 2 days
>   Maximum Volumes = 13
>   LabelFormat = "good_volume_full_${NumVols}"
>   Storage=good_storage
> }
>
> Pool {
>   Name = good_pool_diff
>   Pool Type = Backup
>   Recycle = yes
>   AutoPrune = yes
>   Volume Retention = 6 months
>   Volume Use Duration = 2 days
>   Maximum Volumes = 27
>   LabelFormat = "good_volume_diff_${NumVols}"
>   Storage=good_storage
> }
>
>
> Pool {
>   Name = good_pool_inc
>   Pool Type = Backup
>   Recycle = yes
>   AutoPrune = yes
>   Volume Retention = 1 months
>   Volume Use Duration = 10 hours
>   Maximum Volumes = 26
>   LabelFormat = "good_volume_inc_${NumVols}"
>   Storage=good_storage
> }
>
> Job {
>   Name = good_job
>   Type = Backup
>   Client = good-fd
>   FileSet = "good_files"
>   Schedule = "good_schedule"
>   Storage = good_storage
>   Messages = Standard
>   Pool = good_pool_full
>   Full Backup Pool = good_pool_full
>   Differential Backup Pool = good_pool_diff
>   Incremental Backup Pool = good_pool_inc
>   Priority = 10
>   Max Wait Time = 36000  #10h
>   Maximum Concurrent Jobs = 1
> }
>
> Storage {
>   Name = good_storage
>   Address = 192.168.1.1
>   SDPort = 9103
>   Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>   Device = good_device
>   Media Type = good_device
> }
>
>
> this is the storage configuration:
>
> Device {
>   Name = good_device
>   Media Type = good_device
>   Archive Device = /backups
>   LabelMedia = yes;
>   Random Access = Yes;
>   AutomaticMount = yes;
>   RemovableMedia = no;
>   AlwaysOpen = no;
> }
>
>
> this is the output before confirm a restore job:
>
> Run Restore job
> JobName:         RestoreFiles
> Bootstrap:       /var/lib/bacula/mydir-dir.restore.4.bsr
> Where:           /restores
> Replace:         always
> FileSet:         good_files
> Backup Client:   mydir-fd
> Restore Client:  mydir-fd
> Storage:         good_storage
> When:            2015-11-23 20:42:54
> Catalog:         good_catalog
> Priority:        10
> Plugin Options:  *None*
> OK to run? (yes/mod/no):
>
>
> this is an example of a volume:
>
> |      91 | good_volume_diff_23 | Used      |       1 |   475,980,380 |
>      0 |   15,552,000 |       1 |    0 |         0 | good_device |
> 2015-06-22 00:08:11 |
>
>
> i can't understand this behaviour, have you got any idea?
>
> thank you in advance and let me know if you  need more informations.
>
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
>
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to