Using a Password file with sqb2mtf command line

Forum for users of Red Gate SQL Backup tool

Moderator: Chris Auckland

Using a Password file with sqb2mtf command line

Postby pamozer » Mon Jan 20, 2014 9:06 pm

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"
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm

Postby Manfred.Castro » Fri Jan 24, 2014 5:21 pm

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
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby pamozer » Fri Jan 24, 2014 5:33 pm

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?
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm

Postby Manfred.Castro » Fri Jan 24, 2014 6:03 pm

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/displ ... RTPASSWORD
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby pamozer » Fri Jan 24, 2014 6:59 pm

Do you know if I can ecrypt witht a password file and decrypt with just the password using the converter?
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm

Postby Manfred.Castro » Fri Jan 24, 2014 8:11 pm

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
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby pamozer » Fri Jan 24, 2014 8:14 pm

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
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm

Postby Manfred.Castro » Fri Jan 24, 2014 8:32 pm

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
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby pamozer » Fri Jan 24, 2014 8:38 pm

Yes. It is the right path and the service account has permissions. What about the syntax error message?
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm

Postby Manfred.Castro » Fri Jan 24, 2014 9:48 pm

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
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm

Postby pamozer » Fri Jan 24, 2014 10:43 pm

I figured out the problem. Stupid mistake on my part. Thanks for all your help
pamozer
 
Posts: 13
Joined: Mon Jan 20, 2014 8:51 pm


Return to SQL Backup Previous Versions

Who is online

Users browsing this forum: No registered users and 1 guest