dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Copy-SqlDatabase Start/Finish timing for end of migration is inaccurate

Open wsmelton opened this issue 10 years ago • 4 comments

So doing migration for client yesterday, captured the output and found the ending start/completed for the whole migration process is wrong.

Database 1:
Started: 09/18/2016 07:31:06
Finished: 09/18/2016 07:45:14

Datbase 2:
Started: 09/18/2016 07:45:15
Finished: 09/18/2016 07:45:50

Database 3:
Started: 09/18/2016 07:45:50
Finished: 09/18/2016 07:46:04

Database 4:
Started: 09/18/2016 07:46:04
Finished: 09/18/2016 07:46:12

Database 5:
Started: 09/18/2016 07:46:12
Finished: 09/18/2016 07:48:13

Database 6:
Started: 09/18/2016 07:48:15
Finished: 09/18/2016 10:35:09

Database 7:
Started: 09/18/2016 10:35:09
Finished: 09/18/2016 10:35:10

Database 8:
Started: 09/18/2016 10:35:10
Finished: 09/18/2016 10:35:12

Database migration finished
Migration started: 09/18/2016 10:35:10
Migration completed: 09/18/2016 10:35:12
Total Elapsed time: 00:00:02

Total Elapsed time cannot be just 2 seconds.

wsmelton avatar Sep 19 '16 05:09 wsmelton

it seems that in your case the total elapsed lines up with the timings for the last database. Did you use the pipeline to migrate databases or a single copy-sqldatabase command ? The only culprit I see in the current code is that the timer is started in the PROCESS block, but it should only pose an issue if using the pipeline. @wsmelton if you can confirm, I'd go moving the timer up in the BEGIN block.

niphlod avatar Jan 16 '17 21:01 niphlod

Personally, and think this will be addressed in code blackout, I don't see a purpose in all the output. I don't really care how long it takes, as long as it is done.

wsmelton avatar Jan 16 '17 22:01 wsmelton

I agree with @wsmelton I'm sure some people want to see a time output, but I think most people using the tool only want to see an error. We should hide the happy paths and other irrelevant output.

Might be good for troubleshooting though.

SirCaptainMitch avatar Jan 17 '17 00:01 SirCaptainMitch

We now remove this information entirely and only report the current time

potatoqualitee avatar Jul 23 '17 11:07 potatoqualitee