HPE OneView
1833861 Members
1969 Online
110063 Solutions
New Discussion

Re: upload previously backed up file

 
SOLVED
Go to solution
bradawk1
Trusted Contributor

upload previously backed up file

I can't quite figure out the curl syntax to upload a previously downloaded offline backup.  So, I broke down and got python-oneview installed.  In the examples, it says to upload a backup file with:

backup_details = oneview_client.backups.upload(filename)

I tried replacing filename with '/path/to/backup-file.bkp' but that did not work.  Does anyone know how I am supposed to format the filename?

2 REPLIES 2
bradawk1
Trusted Contributor
Solution

Re: upload previously backed up file

I figured it out.  I ran:

import hpeOneView
from hpeOneView.oneview_client import OneViewClient
from pprint import pprint
from hpeOneView.exceptions import HPEOneViewException
oneview_client = OneViewClient.from_json_file('/root/.oneview/config.json')
backup_details = oneview_client.backups.upload('/data/oneview-backup/oneview_backup_2023-10-27_0923.bkp')
pprint(backup_details)
restores = oneview.client.restores
uri_of_backup_to_restore = backup_details['uri']
options = { "uriOfBackupToRestore": uri_of_backup_to_restore }
restore = resotres.restore(options)
pprint(restore.data)

and it is progressing through the restore!

Sunitha_Mod
Honored Contributor

Re: upload previously backed up file

Hello @bradawk1,

That's excellent! 

We are extremely glad to know you were able to figure it out. We appreciate you for keeping us posted.