Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move-SqlDatabaseFile commited to development branch needs testing #176

Closed
dansqldba opened this issue Sep 9, 2016 · 5 comments
Closed

Comments

@dansqldba
Copy link
Contributor

Review #175 and test appropriately, probably just focus on any files changed which are shared etc.

@dansqldba
Copy link
Contributor Author

Paging @ClaudioESSilva here's the existing issue for your cmdlet!

@ClaudioESSilva
Copy link
Collaborator

ClaudioESSilva commented Sep 19, 2016

The subset of tests is repetead for each method of copy (Local, remote (UNC-PATHS) and full-remote (PSSession))
I have copy&pasted so you can check each one individualy.
Any other test that came to your mind please fell free. We can talk first if you want.

  1. Run scritps local (same host than sql server instance) - This should use robocopy to copy the files, if not exists use Start-BitsTransfer
    • Only one file - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination. Will do an DBCC CHECKDB after database come online.
    • Two files - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination (with this method you only choose on destination for all files).
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -NoDbccCheckDb switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will less time than the examples before because no checkdb will be run on database.
    • Only one file with -DeleteSourceFiles switch - Execute command only with -SqlServer, one database and -DeleteSourceFiles. When all the process ends, the files no longer be available on the source.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -ExportDatabaseStructure and -OutFile ".csv" - Will generate a csv file with all database structure. A message must appear at the end saying which command you should run after change de csv in order to move files.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -MoveFromCSV and -InputFile ".csv" - Will move all files specified on csv with valid "DestinationFolderPath" values.
    • try to move a file with a size bigger than the existing freespace on the destination drive/lun
    • try to move a file to an folder where you don't have access
  2. Run scritps remotely (outside the host of sql server instance) - This should use robocopy to copy the files, if not exists use Start-BitsTransfer
    • Only one file - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination. This should use Start-BitsTransfer to copy the files and do an DBCC CHECKDB after database came online.
    • Two files - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination (with this method you only choose on destination for all files).
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -NoDbccCheckDb switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will less time than the examples before because no checkdb will be run on database.
    • Only one file with -DeleteSourceFiles switch - Execute command only with -SqlServer, one database and -DeleteSourceFiles. When all the process ends, the files no longer be available on the source.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -ExportDatabaseStructure and -OutFile ".csv" - Will generate a csv file with all database structure. A message must appear at the end saying which command you should run after change de csv in order to move files.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -MoveFromCSV and -InputFile ".csv" - Will move all files specified on csv with valid "DestinationFolderPath" values.
    • try to move a file with a size bigger than the existing freespace on the destination drive/lun
    • try to move a file to an folder where you don't have access
  3. Run scritps full-remote (outside the host of sql server instance and without access to UNC paths) - This should use robocopy to copy the files, but only if PSSession is available to be used
    • Only one file - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination. This should use Start-BitsTransfer to copy the files and do an DBCC CHECKDB after database came online.
    • Two files - Execute command only with -SqlServer and -Databases one database parameters. Choose one file, choose destination (with this method you only choose on destination for all files).
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -CheckFileHash switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will take longer than the example before because for each file choosed an hash will be generated for source and destination files to garantee that is the same.
    • Two files with -NoDbccCheckDb switch - Execute command only with -SqlServer, one database and -CheckFileHash. This will less time than the examples before because no checkdb will be run on database.
    • Only one file with -DeleteSourceFiles switch - Execute command only with -SqlServer, one database and -DeleteSourceFiles. When all the process ends, the files no longer be available on the source.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -ExportDatabaseStructure and -OutFile ".csv" - Will generate a csv file with all database structure. A message must appear at the end saying which command you should run after change de csv in order to move files.
    • Generate csv with file structure - Execute command with -SqlServer, one database, -MoveFromCSV and -InputFile ".csv" - Will move all files specified on csv with valid "DestinationFolderPath" values.
    • try to move a file with a size bigger than the existing freespace on the destination drive/lun
    • try to move a file to an folder where you don't have access

@dansqldba
Copy link
Contributor Author

This is beautiful @ClaudioESSilva, exactly what I wanted 👍 :)

@dansqldba dansqldba modified the milestones: October 2016 Release, November 2016 Release Oct 1, 2016
@dansqldba dansqldba modified the milestones: antsinmyeyesjohnson, December 2016 Release Nov 22, 2016
@dansqldba dansqldba removed this from the schleem milestone Dec 14, 2016
@niphlod
Copy link
Contributor

niphlod commented Feb 16, 2017

@ClaudioESSilva : sorry for pinging but isn't this a "duplicate" of #250 ?

@ClaudioESSilva
Copy link
Collaborator

@niphlod no problem. Yes this one was the first. Those tests can be copied later for a new PR.
For now this can be closed.

@wsmelton wsmelton closed this as completed Mar 5, 2017
@ghost ghost removed the needs testing label Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants