dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Support for startup scripts in Start-DbaMigration

Open AGregersen opened this issue 5 years ago • 2 comments

Summary of new feature

Currently the Start-DbaMigration doesn't migrate the configuration of Startup scripts - meaning those scripts configured to run at SQL Server startup won't run on the new server. I don't know if it's a commonly used feature in SQL, but Microsoft AX Dynamics 2012R3 use it to ensure special permissions on tempdb.

Proposed technical details (if applicable)

It should use the output of Use [master] SELECT [name] FROM sysobjects WHERE type = 'P' AND OBJECTPROPERTY(id, 'ExecIsStartUp') = 1

and then execute on master for each row of the output above on the target server EXEC SP_PROCOPTION , 'STARTUP', 'ON'

Latest version of dbatools as of writing

1.0.141

AGregersen avatar Apr 15 '21 06:04 AGregersen

Agreed! I think I tried this before and ran into a snag (not a huge one, just one I didn't have time for). But it would be good to add.

potatoqualitee avatar Jun 22 '21 10:06 potatoqualitee

haha, awesome @wsmelton already wrote this one and it is included in Start-DbaMigration as well. Check out Copy-DbaStartupProcedure

potatoqualitee avatar Jul 26 '21 13:07 potatoqualitee