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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newcommand move sqldatabasefile #175

Merged
merged 26 commits into from
Sep 8, 2016

Conversation

ClaudioESSilva
Copy link
Collaborator

馃巻 Finally alpha version ready to test. 馃巻
@ctrlbold, @dansqldba, @js0505, everyone can you guys test/try it?

Any question / suggestion please say something.

- 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
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
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
@dansqldba dansqldba deleted the NewCommand_Move-SqlDatabaseFile branch September 18, 2016 21:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants