{"id":873,"date":"2015-01-10T20:54:47","date_gmt":"2015-01-10T14:54:47","guid":{"rendered":"http:\/\/dotnetsql.info\/net-sql\/?p=873"},"modified":"2015-07-09T16:08:33","modified_gmt":"2015-07-09T10:08:33","slug":"how-to-change-default-snapshot-folder-for-replication","status":"publish","type":"post","link":"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/","title":{"rendered":"How to change default snapshot folder for Replication?"},"content":{"rendered":"<h3><strong>Scenario<\/strong><\/h3>\n<p>You&#8217;ve set up replication initially by using the GUI and accepting all defaults and now due to growth you need to change your default replication snapshot folder location to another drive since the current location is a local disk and cannot be expanded to accommodate the growth.<\/p>\n<p>This concerns you as you cannot afford downtime to perform a re-initialization of all your existing subscribers as they are needed to run the business.<\/p>\n<p><strong>Solution<\/strong><\/p>\n<p>You can change the snapshot location without having to perform a re-initialization. The only caveat to this is you do need to generate a new snapshot. This snapshot will not be applied to your subscribers, but has to go through the generation process. I recommend doing this at night or weekends to minimize the impact of the snapshot agent locking tables and contention on the publisher database.<!--more--><\/p>\n<h3><strong>Current Snapshot Location for a Publication<\/strong><\/h3>\n<p>You can see the snapshot folder is currently pointed at a share called &#8220;&#92;Some_Server_Name\\Share&#8221;. This is your snapshot location that will change later in the tip.\u00a0 To get to this screen right click on your publication and select Properties and click on Snapshot.\u00a0 You could change the location of the snapshot here, but this would need to be done for all publications.<\/p>\n<h3><strong>Current Snapshot Filesystem Folder<\/strong><\/h3>\n<p>This shows the snapshot files that are located in &#8220;&#92;Some_Server_Name\\Share&#8221; meaning it was used to perform the initialization of this subscription.<\/p>\n<h3><strong>Changing Default Snapshot Location<\/strong><\/h3>\n<p>The script below changes the default snapshot location to &#8220;&#92;Some_Server_Name\\Share2&#8221; from &#8220;&#92;Some_Server_Name\\Share&#8221; for all publications..<\/p>\n<p>In your environment this could be a different mount point that has expandable storage. This is accomplished by calling <strong>sp_changedistpublisher<\/strong> and updating the working directory. This procedure takes a &#8220;publisher&#8221;, &#8220;property&#8221; and &#8220;value&#8221; parameters and needs to be run on the <strong>distributor<\/strong>.\u00a0 You can learn more about this here <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms186749.aspx\" target=\"_blank\">sp_changedistpublisher<\/a>.<\/p>\n<pre>USE distribution<\/pre>\n<pre>exec sp_changedistpublisher<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0@publisher = 'Some_Server_Name',<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0@property = 'working_directory',<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0@value = '\\\\Some_Server_Name\\Share2'<\/pre>\n<p>This can also be changed from SSMS by right clicking on Replication, selecting Properties, select Publishers and click on &#8220;&#8230;&#8221; to bring up this window.<\/p>\n<h3><strong>Synchronization After Changing Snapshot Location<\/strong><\/h3>\n<p>As you can see the sync completed without error after changing the snapshot location. I inserted some rows after changing the snapshot location and performed a sync manually to ensure there were no errors in replication.<\/p>\n<h3><strong>New Snapshot Location<\/strong><\/h3>\n<p>When looking at the publication properties a second time, you can see it is now showing &#8220;&#92;Some_Server_Name\\Share2&#8221; instead of the original snapshot location of &#8220;&#92;Some_Server_Name\\Share&#8221;.<\/p>\n<h3><\/h3>\n<p>As you can see changing the snapshot location was a painless process and the next time the snapshot agent runs it will write to the new location. Normal synchronization occurs without interruption.<\/p>\n<p><strong>Thanks for reading this article,<\/strong><\/p>\n<p><strong>Next steps :<\/strong><\/p>\n<ol>\n<li><strong>Share this with your colleagues because Sharingis Learning<\/strong><\/li>\n<li><strong>Comment below if you need any assistance<\/strong><\/li>\n<\/ol>\n<p style=\"text-align: right;\"><em><strong>Powered by <a href=\"http:\/\/www.codereview.co\">CodeReview &#8211; Let&#8217;s make it Better!<\/a><\/strong><\/em><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-873\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-873\" class=\"share-linkedin sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on LinkedIn (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-873\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" data-shared=\"sharing-google-873\" class=\"share-google-plus-1 sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Google+ (Opens in new window)<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pocket (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-76243027-873-69e2284f16980' data-src='\/\/widgets.wp.com\/likes\/#blog_id=76243027&amp;post_id=873&amp;origin=dotnetsql.info&amp;obj_id=76243027-873-69e2284f16980' data-name='like-post-frame-76243027-873-69e2284f16980'><h3 class='sd-title'>Like this:<\/h3><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height:55px'><span class='button'><span>Like<\/span><\/span> <span class=\"loading\">Loading...<\/span><\/div><span class='sd-text-color'><\/span><a class='sd-link-color'><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>Scenario You&#8217;ve set up replication initially by using the GUI and accepting all defaults and now due to growth you need to change your default replication snapshot folder location to another drive since the current location is a local disk and cannot be expanded to accommodate the growth. This concerns you as you cannot afford &hellip; <a href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to change default snapshot folder for Replication?<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow\" data-shared=\"sharing-twitter-873\" class=\"share-twitter sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Twitter (Opens in new window)<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow\" data-shared=\"sharing-linkedin-873\" class=\"share-linkedin sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on LinkedIn (Opens in new window)<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow\" data-shared=\"sharing-facebook-873\" class=\"share-facebook sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=facebook\" target=\"_blank\" title=\"Share on Facebook\"><span><\/span><span class=\"sharing-screen-reader-text\">Share on Facebook (Opens in new window)<\/span><\/a><\/li><li class=\"share-google-plus-1\"><a rel=\"nofollow\" data-shared=\"sharing-google-873\" class=\"share-google-plus-1 sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=google-plus-1\" target=\"_blank\" title=\"Click to share on Google+\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Google+ (Opens in new window)<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-pocket sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to share on Pocket (Opens in new window)<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow\" data-shared=\"\" class=\"share-email sd-button share-icon no-text\" href=\"http:\/\/dotnetsql.info\/net-sql\/index.php\/how-to-change-default-snapshot-folder-for-replication\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span><\/span><span class=\"sharing-screen-reader-text\">Click to email this to a friend (Opens in new window)<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><div class='sharedaddy sd-block sd-like jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded' id='like-post-wrapper-76243027-873-69e2284f16e6e' data-src='\/\/widgets.wp.com\/likes\/#blog_id=76243027&amp;post_id=873&amp;origin=dotnetsql.info&amp;obj_id=76243027-873-69e2284f16e6e' data-name='like-post-frame-76243027-873-69e2284f16e6e'><h3 class='sd-title'>Like this:<\/h3><div class='likes-widget-placeholder post-likes-widget-placeholder' style='height:55px'><span class='button'><span>Like<\/span><\/span> <span class=\"loading\">Loading...<\/span><\/div><span class='sd-text-color'><\/span><a class='sd-link-color'><\/a><\/div>","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[235,267,90,269,268],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/873"}],"collection":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/comments?post=873"}],"version-history":[{"count":6,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/873\/revisions"}],"predecessor-version":[{"id":998,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/posts\/873\/revisions\/998"}],"wp:attachment":[{"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/media?parent=873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/categories?post=873"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dotnetsql.info\/net-sql\/index.php\/wp-json\/wp\/v2\/tags?post=873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}