-
-
Notifications
You must be signed in to change notification settings - Fork 787
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newcommand move sqldatabasefile #175
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Use PSSession! (Will support local execution) - Move only 1 file. - Various tests with success.
Copy Local using BITS Copy Remotly using Robocopy Both working for a single file!
Generate a CSV with all files within database. Added a column "destination" so user can fil with the desired path. User must remove all lines matching files he don't want move.
Added move from CSV file Added progressbar Added FileType parameter so we can move all files of a specific type
All working
Files seems to be blocked. So can't view progress only 100%..
Still missing progress bar
- Added progressbar to Copy-Item method - Review and unify tests before start copy - Add try/catch so if copy fails, delete do not happen and only remove file if it exists on both folders Still missing: - some cleanup (mainly Remote-PSSession / robocopy method) - More help / description / examples
Thanks @ctrlbold!
tests.. and test... and nothing seems to work...
- Added MD5 hash validation after copy. Compare-FileHashs - Verify if local PC if not verify for remote UNC paths access. - Wait until database goes OFFLINE (with "remote" files SET offline seems to take longer - Added CheckDB function to run after bring Online - Correct progress-bar not showing error when copying only 1 file -
- Removed Copy-Item method (is synchronous). - If robocopy exists will use it instead of Start-BitsTransfer. Robocopy is much faster. (1GB -> Down from 23sec to 6sec) - MD5 generation can be (1GB +- 13sec)
- Progressbar with robocopy and PSSession working. Thanks @ctrlbold for the tip. - Remover old code from old tests - Created Get-FileHash function - Add -Force to move on even if DBCC CHECDB return error
Added help for some missing parameters
- Add new parameters -> CheckFileHash -> NoDbccCheckDb - Add new functions -> Remove-OldFile - More documentation
- Added -DeleteSourceFiles parameter - Added Test-PathsAccess function - Modifying filesToMove collection to fill with all data regarding UNC paths (work in progress)
- Test-Path for first object in collection in order to know if exists connectivity by UNC path - New function to Disconnect and remove PSSession - Moved stuff arround - Add support columns to collection of files to move
- Add new function Check-SpaceRequirements where we use Get-DbaDiskSpace - Added filesize and drive columns to collection - Moved stuff around - deleted redundant code
- Annoying robocopy "bug" corrected. When UNC path can't end with "\" if is root of drive. - When switch -DeleteSourceFiles is not used print commands to delete files when user wants to - Tests done: -> robocopy with unc path -> more than one file -> with -DeleteSourceFiles switch -> with -CheckFileHash switch -> with -NoDbccCheckDb
- Change number of retries to 5 - Change waiting time between retries to 3 seconds - Added flag to say if file was successfully handled - Added new function Get-PSSessionRobocopyLogContent - next: implement WhatIf
- Need to add SupportsShouldProcess to Show-SqlServerFileSystem. Otherwise, using -WhatIf when calling Move-SqlDatabaseFile give some errors. "What if: Performing the operation "Set variable" on target "Name: cancelbutton Value: System.Windows.Controls.Button: Cancel"." Need to add -WhatIf:$false when calling function 馃挘 :mindblow: - Removed robocopy execution to get files to be copied. will be only one. Don't need this section. Only usefull when used with multiple files.
More examples
because branches conflicts
Because merge conflict
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
馃巻 Finally alpha version ready to test. 馃巻
@ctrlbold, @dansqldba, @js0505, everyone can you guys test/try it?
Any question / suggestion please say something.