Red Gate forums :: View topic - Using a Password file with sqb2mtf command line
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup Previous Versions
SQL Backup Previous Versions forum

Using a Password file with sqb2mtf command line

Search in SQL Backup Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Mon Jan 20, 2014 9:06 pm    Post subject: Using a Password file with sqb2mtf command line Reply with quote

Can I use a password file with sqb2mtf command? Or can I only use a password when the backup is encrypted. HEre is what I am trying to do.

SQB2MTF "c:\FULL_DB024_KareoMaintenance_20140120_113510_encr.sqb" "c:\FULL_DB024_KareoMaintenance_20140120_113510_encr.bak" "Password=FILE:C:\REDGATE\Backup.txt"
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Fri Jan 24, 2014 5:21 pm    Post subject: Reply with quote

You can only use a password when the backup (sqb) is encrypted.
The password is used to decrypt an encrypted sqb file during the conversion.
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Fri Jan 24, 2014 5:33 pm    Post subject: Reply with quote

My question isn't clear. I want to use a password file instead of a hard coded password,. Can I use that with the sqb2mtf?
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Fri Jan 24, 2014 6:03 pm    Post subject: Reply with quote

It doesn't appear that the password in a text file was implemented in the standalone converters.
I tried both sqb2mtf.exe and SqbConverter.exe and was unsuccessful.
If you want to convert a file from the command line you could use the convert command from the command line.

SQLBackupC.exe -I {instance name} -SQL "CONVERT 'C:\Backups\pubs.sqb' TO 'C:\Backups\pubs.bak' WITH PASSWORD = 'FILE:C:\mypasswords\password.txt'"

http://documentation.red-gate.com/display/SBU7/The+CONVERT+command#TheCONVERTcommand-CONVERTPASSWORD
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Fri Jan 24, 2014 6:59 pm    Post subject: Reply with quote

Do you know if I can ecrypt witht a password file and decrypt with just the password using the converter?
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Fri Jan 24, 2014 8:11 pm    Post subject: Reply with quote

I just did a quick test and yes you can encrypt with a password file and decrypt with just the password using the converter.
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Fri Jan 24, 2014 8:14 pm    Post subject: Reply with quote

Thank you for all your help. Can you tell my why I am getting a syntax error with this?

[code]
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASE [10163] TO DISK = ''\\pd-cifs-1\sql_backups\db001\<AUTO>_encr.sqb'' WITH PASSWORD = ''FILE:C:\redgate\dcr.txt'', KEYSIZE=256,CHECKSUM, DISKRETRYINTERVAL = 30, DISKRETRYCOUNT = 10, COMPRESSION = 4" '
[/code]


SQL Backup v7.6.0.29
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Syntax error: 'FILE:C:\redgate\dcr.txt' after '='
Password file does not exist: C:\redgate\dcr.txt

(2 row(s) affected)

name value
---------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
exitcode 850
sqlerrorcode 0
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Fri Jan 24, 2014 8:32 pm    Post subject: Reply with quote

The error indicates that: Password file does not exist: C:\redgate\dcr.txt
Is the file name and path correct?
It could also be permissions to the folder.
The logon account of the SQL Backup Agent have rights to the folder?
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Fri Jan 24, 2014 8:38 pm    Post subject: Reply with quote

Yes. It is the right path and the service account has permissions. What about the syntax error message?
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Fri Jan 24, 2014 9:48 pm    Post subject: Reply with quote

The syntax is fine.
I pretty much copied your command and it worked, I only changed the database name and the disk path.
The main thing it is compalining about is:
Password file does not exist: C:\redgate\dcr.txt

Try giving the log on account of the SQL Backup Agent explicit rights to the folder.
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
pamozer



Joined: 20 Jan 2014
Posts: 13

PostPosted: Fri Jan 24, 2014 10:43 pm    Post subject: Reply with quote

I figured out the problem. Stupid mistake on my part. Thanks for all your help
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group