{"action":"closed","number":4196,"pull_request":{"url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196","id":222471136,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNDcxMTM2","html_url":"https://github.com/sqlcollaborative/dbatools/pull/4196","diff_url":"https://github.com/sqlcollaborative/dbatools/pull/4196.diff","patch_url":"https://github.com/sqlcollaborative/dbatools/pull/4196.patch","issue_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4196","number":4196,"state":"closed","locked":false,"title":"Speedup Copy-DbaDatabase","user":{"login":"alevyinroc","id":6306831,"node_id":"MDQ6VXNlcjYzMDY4MzE=","avatar_url":"https://avatars1.githubusercontent.com/u/6306831?v=4","gravatar_id":"","url":"https://api.github.com/users/alevyinroc","html_url":"https://github.com/alevyinroc","followers_url":"https://api.github.com/users/alevyinroc/followers","following_url":"https://api.github.com/users/alevyinroc/following{/other_user}","gists_url":"https://api.github.com/users/alevyinroc/gists{/gist_id}","starred_url":"https://api.github.com/users/alevyinroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alevyinroc/subscriptions","organizations_url":"https://api.github.com/users/alevyinroc/orgs","repos_url":"https://api.github.com/users/alevyinroc/repos","events_url":"https://api.github.com/users/alevyinroc/events{/privacy}","received_events_url":"https://api.github.com/users/alevyinroc/received_events","type":"User","site_admin":false},"body":"<!-- Below information IS REQUIRED with every PR -->\r\n## Type of Change\r\n<!-- What type of change does your code introduce -->\r\n - [ ] Bug fix (non-breaking change, fixes #<enter issue number>)\r\n - [X] New feature (non-breaking change, adds functionality)\r\n - [ ] Breaking change (effects multiple commands or functionality)\r\n - [ ] Ran manual Pester test and has passed (`.\\tests\\manual.pester.ps1)\r\n - [ ] Adding code coverage to existing functionality\r\n - [ ] Pester test is included\r\n - [ ] Nunit test is included\r\n - [ ] Documentation\r\n - [ ] Build system\r\n \r\n<!-- Below this line you can erase anything that is not applicable -->\r\n### Purpose\r\nOn instances with large numbers of databases, the call to `$destServer.databases.refresh()` can take a long time but only the new database needs to be refreshed (for comparison against properties of the source DB)\r\n\r\n### Approach\r\nReplaced refreshing all databases on the instance with getting a reference to just the new database that was restored.\r\n\r\nOn my test instance with 300+ databases, this was approx. a 10% speed improvement.\r\n\r\n### Commands to test\r\n`Copy-DbaDatabase`\r\n\r\n","created_at":"2018-10-12T13:43:03Z","updated_at":"2018-10-12T21:13:43Z","closed_at":"2018-10-12T21:13:43Z","merged_at":"2018-10-12T21:13:43Z","merge_commit_sha":"fc627b656ed230eb1aa70d3f54db7d0bd135a7e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196/commits","review_comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196/comments","review_comment_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4196/comments","statuses_url":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/86e83a8a8b3a64e718bea9b6775a0a28fac318c5","head":{"label":"alevyinroc:Speedup-CopyDB","ref":"Speedup-CopyDB","sha":"86e83a8a8b3a64e718bea9b6775a0a28fac318c5","user":{"login":"alevyinroc","id":6306831,"node_id":"MDQ6VXNlcjYzMDY4MzE=","avatar_url":"https://avatars1.githubusercontent.com/u/6306831?v=4","gravatar_id":"","url":"https://api.github.com/users/alevyinroc","html_url":"https://github.com/alevyinroc","followers_url":"https://api.github.com/users/alevyinroc/followers","following_url":"https://api.github.com/users/alevyinroc/following{/other_user}","gists_url":"https://api.github.com/users/alevyinroc/gists{/gist_id}","starred_url":"https://api.github.com/users/alevyinroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alevyinroc/subscriptions","organizations_url":"https://api.github.com/users/alevyinroc/orgs","repos_url":"https://api.github.com/users/alevyinroc/repos","events_url":"https://api.github.com/users/alevyinroc/events{/privacy}","received_events_url":"https://api.github.com/users/alevyinroc/received_events","type":"User","site_admin":false},"repo":{"id":96139903,"node_id":"MDEwOlJlcG9zaXRvcnk5NjEzOTkwMw==","name":"dbatools","full_name":"alevyinroc/dbatools","private":false,"owner":{"login":"alevyinroc","id":6306831,"node_id":"MDQ6VXNlcjYzMDY4MzE=","avatar_url":"https://avatars1.githubusercontent.com/u/6306831?v=4","gravatar_id":"","url":"https://api.github.com/users/alevyinroc","html_url":"https://github.com/alevyinroc","followers_url":"https://api.github.com/users/alevyinroc/followers","following_url":"https://api.github.com/users/alevyinroc/following{/other_user}","gists_url":"https://api.github.com/users/alevyinroc/gists{/gist_id}","starred_url":"https://api.github.com/users/alevyinroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alevyinroc/subscriptions","organizations_url":"https://api.github.com/users/alevyinroc/orgs","repos_url":"https://api.github.com/users/alevyinroc/repos","events_url":"https://api.github.com/users/alevyinroc/events{/privacy}","received_events_url":"https://api.github.com/users/alevyinroc/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alevyinroc/dbatools","description":"PowerShell module to help SQL Server Pros be more productive","fork":true,"url":"https://api.github.com/repos/alevyinroc/dbatools","forks_url":"https://api.github.com/repos/alevyinroc/dbatools/forks","keys_url":"https://api.github.com/repos/alevyinroc/dbatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alevyinroc/dbatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alevyinroc/dbatools/teams","hooks_url":"https://api.github.com/repos/alevyinroc/dbatools/hooks","issue_events_url":"https://api.github.com/repos/alevyinroc/dbatools/issues/events{/number}","events_url":"https://api.github.com/repos/alevyinroc/dbatools/events","assignees_url":"https://api.github.com/repos/alevyinroc/dbatools/assignees{/user}","branches_url":"https://api.github.com/repos/alevyinroc/dbatools/branches{/branch}","tags_url":"https://api.github.com/repos/alevyinroc/dbatools/tags","blobs_url":"https://api.github.com/repos/alevyinroc/dbatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alevyinroc/dbatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alevyinroc/dbatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/alevyinroc/dbatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alevyinroc/dbatools/statuses/{sha}","languages_url":"https://api.github.com/repos/alevyinroc/dbatools/languages","stargazers_url":"https://api.github.com/repos/alevyinroc/dbatools/stargazers","contributors_url":"https://api.github.com/repos/alevyinroc/dbatools/contributors","subscribers_url":"https://api.github.com/repos/alevyinroc/dbatools/subscribers","subscription_url":"https://api.github.com/repos/alevyinroc/dbatools/subscription","commits_url":"https://api.github.com/repos/alevyinroc/dbatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/alevyinroc/dbatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/alevyinroc/dbatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/alevyinroc/dbatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/alevyinroc/dbatools/contents/{+path}","compare_url":"https://api.github.com/repos/alevyinroc/dbatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alevyinroc/dbatools/merges","archive_url":"https://api.github.com/repos/alevyinroc/dbatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alevyinroc/dbatools/downloads","issues_url":"https://api.github.com/repos/alevyinroc/dbatools/issues{/number}","pulls_url":"https://api.github.com/repos/alevyinroc/dbatools/pulls{/number}","milestones_url":"https://api.github.com/repos/alevyinroc/dbatools/milestones{/number}","notifications_url":"https://api.github.com/repos/alevyinroc/dbatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alevyinroc/dbatools/labels{/name}","releases_url":"https://api.github.com/repos/alevyinroc/dbatools/releases{/id}","deployments_url":"https://api.github.com/repos/alevyinroc/dbatools/deployments","created_at":"2017-07-03T18:38:08Z","updated_at":"2018-10-12T13:44:44Z","pushed_at":"2018-10-12T18:06:10Z","git_url":"git://github.com/alevyinroc/dbatools.git","ssh_url":"git@github.com:alevyinroc/dbatools.git","clone_url":"https://github.com/alevyinroc/dbatools.git","svn_url":"https://github.com/alevyinroc/dbatools","homepage":"https://dbatools.io","size":89394,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sqlcollaborative:development","ref":"development","sha":"fdbc214eb91c13fa9cdc186c7bb45c5789e9ab9f","user":{"login":"sqlcollaborative","id":22203347,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjAzMzQ3","avatar_url":"https://avatars3.githubusercontent.com/u/22203347?v=4","gravatar_id":"","url":"https://api.github.com/users/sqlcollaborative","html_url":"https://github.com/sqlcollaborative","followers_url":"https://api.github.com/users/sqlcollaborative/followers","following_url":"https://api.github.com/users/sqlcollaborative/following{/other_user}","gists_url":"https://api.github.com/users/sqlcollaborative/gists{/gist_id}","starred_url":"https://api.github.com/users/sqlcollaborative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqlcollaborative/subscriptions","organizations_url":"https://api.github.com/users/sqlcollaborative/orgs","repos_url":"https://api.github.com/users/sqlcollaborative/repos","events_url":"https://api.github.com/users/sqlcollaborative/events{/privacy}","received_events_url":"https://api.github.com/users/sqlcollaborative/received_events","type":"Organization","site_admin":false},"repo":{"id":30215226,"node_id":"MDEwOlJlcG9zaXRvcnkzMDIxNTIyNg==","name":"dbatools","full_name":"sqlcollaborative/dbatools","private":false,"owner":{"login":"sqlcollaborative","id":22203347,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjAzMzQ3","avatar_url":"https://avatars3.githubusercontent.com/u/22203347?v=4","gravatar_id":"","url":"https://api.github.com/users/sqlcollaborative","html_url":"https://github.com/sqlcollaborative","followers_url":"https://api.github.com/users/sqlcollaborative/followers","following_url":"https://api.github.com/users/sqlcollaborative/following{/other_user}","gists_url":"https://api.github.com/users/sqlcollaborative/gists{/gist_id}","starred_url":"https://api.github.com/users/sqlcollaborative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqlcollaborative/subscriptions","organizations_url":"https://api.github.com/users/sqlcollaborative/orgs","repos_url":"https://api.github.com/users/sqlcollaborative/repos","events_url":"https://api.github.com/users/sqlcollaborative/events{/privacy}","received_events_url":"https://api.github.com/users/sqlcollaborative/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sqlcollaborative/dbatools","description":"PowerShell module to help SQL Server Pros be more productive","fork":false,"url":"https://api.github.com/repos/sqlcollaborative/dbatools","forks_url":"https://api.github.com/repos/sqlcollaborative/dbatools/forks","keys_url":"https://api.github.com/repos/sqlcollaborative/dbatools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sqlcollaborative/dbatools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sqlcollaborative/dbatools/teams","hooks_url":"https://api.github.com/repos/sqlcollaborative/dbatools/hooks","issue_events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/events{/number}","events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/events","assignees_url":"https://api.github.com/repos/sqlcollaborative/dbatools/assignees{/user}","branches_url":"https://api.github.com/repos/sqlcollaborative/dbatools/branches{/branch}","tags_url":"https://api.github.com/repos/sqlcollaborative/dbatools/tags","blobs_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/refs{/sha}","trees_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/{sha}","languages_url":"https://api.github.com/repos/sqlcollaborative/dbatools/languages","stargazers_url":"https://api.github.com/repos/sqlcollaborative/dbatools/stargazers","contributors_url":"https://api.github.com/repos/sqlcollaborative/dbatools/contributors","subscribers_url":"https://api.github.com/repos/sqlcollaborative/dbatools/subscribers","subscription_url":"https://api.github.com/repos/sqlcollaborative/dbatools/subscription","commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/commits{/sha}","git_commits_url":"https://api.github.com/repos/sqlcollaborative/dbatools/git/commits{/sha}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/comments{/number}","issue_comment_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/comments{/number}","contents_url":"https://api.github.com/repos/sqlcollaborative/dbatools/contents/{+path}","compare_url":"https://api.github.com/repos/sqlcollaborative/dbatools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sqlcollaborative/dbatools/merges","archive_url":"https://api.github.com/repos/sqlcollaborative/dbatools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sqlcollaborative/dbatools/downloads","issues_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues{/number}","pulls_url":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls{/number}","milestones_url":"https://api.github.com/repos/sqlcollaborative/dbatools/milestones{/number}","notifications_url":"https://api.github.com/repos/sqlcollaborative/dbatools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sqlcollaborative/dbatools/labels{/name}","releases_url":"https://api.github.com/repos/sqlcollaborative/dbatools/releases{/id}","deployments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/deployments","created_at":"2015-02-02T23:50:31Z","updated_at":"2018-10-12T17:59:12Z","pushed_at":"2018-10-12T21:13:43Z","git_url":"git://github.com/sqlcollaborative/dbatools.git","ssh_url":"git@github.com:sqlcollaborative/dbatools.git","clone_url":"https://github.com/sqlcollaborative/dbatools.git","svn_url":"https://github.com/sqlcollaborative/dbatools","homepage":"https://dbatools.io","size":91591,"stargazers_count":687,"watchers_count":687,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":371,"mirror_url":null,"archived":false,"open_issues_count":323,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":371,"open_issues":323,"watchers":687,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196"},"html":{"href":"https://github.com/sqlcollaborative/dbatools/pull/4196"},"issue":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4196"},"comments":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4196/comments"},"review_comments":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196/comments"},"review_comment":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/pulls/4196/commits"},"statuses":{"href":"https://api.github.com/repos/sqlcollaborative/dbatools/statuses/86e83a8a8b3a64e718bea9b6775a0a28fac318c5"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"potatoqualitee","id":8278033,"node_id":"MDQ6VXNlcjgyNzgwMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/8278033?v=4","gravatar_id":"","url":"https://api.github.com/users/potatoqualitee","html_url":"https://github.com/potatoqualitee","followers_url":"https://api.github.com/users/potatoqualitee/followers","following_url":"https://api.github.com/users/potatoqualitee/following{/other_user}","gists_url":"https://api.github.com/users/potatoqualitee/gists{/gist_id}","starred_url":"https://api.github.com/users/potatoqualitee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/potatoqualitee/subscriptions","organizations_url":"https://api.github.com/users/potatoqualitee/orgs","repos_url":"https://api.github.com/users/potatoqualitee/repos","events_url":"https://api.github.com/users/potatoqualitee/events{/privacy}","received_events_url":"https://api.github.com/users/potatoqualitee/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":11,"deletions":11,"changed_files":1}}
{"actor":{"display_login":"potatoqualitee"}}