Site collection movement to another content database

HI All,
we are using sharepoint 2010 and have 2 big production web applications. 7 content databases are attached with one web application. Out of 7 cdb's, 3 content databases are more than 200 gb. The rest 4 cdbs are small in size. I want to pick some bigger site
collection from those 3 bigger cdbs, and move them to any of the rest 4 cdb's.
As per my knowledge.
1. All the 7 cdb's are attached to a single web application.
2. CDB's are in same instance of sql server.
My question here is, how (move-SPSITE URL DESTINATIONCONTENTDATABASE WSS_COntent_abc) works.
Question 1.  Will this cmdlets take the backup of URL mentioned , keep it somewhere in file system, and then move it to destination. and then delete it from source.
Question 2: Or it will only move it to destination CDB, and delete it from source. Without taking any backup.
Please help me to understand these questions.
Thanks

Hi,
According to your post, my understanding is that you wanted to move site collection to another content database.
You can use the Windows PowerShell command Move-SPSite to move site collections between content databases. However, it cannot backup the database.
To backup database, you can use the Windows PowerShell command:
Backup-SPFarm -Directory   <Backup folder>  -BackupMethod {Full | Differential} -Item <Content database name> [-Verbose]
More information:
Move site collections between databases (SharePoint Server 2010)
Back up a content database in SharePoint Server 2010
Restore a content database in SharePoint Server 2010
Best Regards,
Linda Li
Linda Li
TechNet Community Support

Similar Messages

  • Site collection in a particular content database

    How can we make sure to create a site collection in a particular content database?
    Arun Prakash

    Hi Arun, 
    There is no direct option from SharePoint UI to select content database while creating Site collection, However you can do that using power shell .. here is the code..
    $url = "http://test/sites/Communities"
    $ContentDatabase = "OSCommunities_Content"
    $WebsiteName = "Communities"
    $WebsiteDesc = "Communities site"
    $Template = "STS#1"
    $PrimaryLogin = "domain\abg-spprodadmin"
    $PrimaryDisplay = "admin"
    $PrimaryEmail = "[email protected]"
    New-SPSite -Url $url –ContentDatabase $ContentDatabase -Name $WebsiteName –Description $WebsiteDesc -Template $Template -OwnerAlias $PrimaryLogin –OwnerEmail $PrimaryEmail

  • Example to see all site collections in a specific content DB in sharepoint 2010

    Can someone give an example to see all site collections in a specific content DB
    in SharePoint 2010.
    I've tried the below ones but it gives all content DB's with all site collections.
    Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}}
    Appreciate your help

    Use Get-SPSite cmdlet
    $spAssgn = Start-SPAssignment;
    Get-SPSite -ContentDatabase "<SPContentDBName>" -Limit ALL -AssignmentCollection $spAssgn|Select Title,Url;
    Stop-SPAssignment $spAssgn;
    Get-SPSite
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Sharepoint client object model - Pull files from one site and move to another

    Dear All,
    I am using client object model to retrieve files of certain criteria using caml query and copy them to some other site using 
    client object model. There is no exception being thrown, but the application is not performing either. No files are being copied to destination. Here is the code. Please advise.
    The message box that I have kept at the end is being displayed, but no files are being copied.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Net;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.SharePoint;
    using SP = Microsoft.SharePoint.Client;
    namespace WindowsFormsApplication2
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void Form1_Load(object sender, EventArgs e)
            private void button1_Click(object sender, EventArgs e)
                SP.ClientContext srcContext = new SP.ClientContext(textBox1.Text);
                srcContext.Credentials = new NetworkCredential(textBox3.Text, textBox4.Text, textBox5.Text);
                SP.ClientContext destContext = new SP.ClientContext(textBox2.Text);
                destContext.Credentials = new NetworkCredential(textBox3.Text, textBox4.Text, textBox5.Text);
                SP.CamlQuery camlQuery = new SP.CamlQuery();
                camlQuery.ViewXml = "<View Scope='RecursiveAll'><Query><Where><And><Geq><FieldRef Name='Created' /><Value IncludeTimeValue='TRUE' Type='DateTime'>2013-01-01T04:16:20Z</Value></Geq><And><Lt><FieldRef
    Name='Created' /><Value IncludeTimeValue='TRUE' Type='DateTime'>2013-12-31T04:16:43Z</Value></Lt><Or><Eq><FieldRef Name='Document_x0020_Classification' /><Value Type='Choice'></Value></Eq><Eq><FieldRef
    Name='Document_x0020_Classification' /><Value Type='Choice'>Case Studies</Value></Eq></Or></And></And></Where></Query></View>";
                SP.Web oWebsite = srcContext.Web;
                srcContext.Load(oWebsite, website => website.Webs);
                srcContext.ExecuteQuery();
                SP.Web dWebsite = destContext.Web;
                destContext.Load(dWebsite);
                destContext.ExecuteQuery();
                foreach (SP.Web web in oWebsite.Webs)
                    MessageBox.Show(web.Title);
                    foreach (SP.List list in web.Lists)
                        if (list.BaseType.ToString() == "DocumentLibrary")
                            MessageBox.Show(list.Title);
                            SP.ListItemCollection collListItem = list.GetItems(camlQuery);
                            srcContext.Load(collListItem);
                            srcContext.ExecuteQuery();
                            foreach (var doc in collListItem)
                                        SP.File f = doc.File;
                                        srcContext.Load(f);
                                        srcContext.ExecuteQuery();
                                        string destLibrary = "shared Documents";
                                        string nLocation = dWebsite.ServerRelativeUrl.TrimEnd('/') + "/" + destLibrary.Replace(" ", "")
    + "/" + f.Name;
                                        SP.FileInformation fileInfo = SP.File.OpenBinaryDirect(srcContext, f.ServerRelativeUrl);
                                        SP.File.SaveBinaryDirect(destContext, nLocation, fileInfo.Stream, true);
                MessageBox.Show("Completed");
    sk.Rakhishma

    Hi,
    To copy files from one site collection to another site collection, the simplest way is to open document library in windows explorer view.
    Go to document library, click library tab, click open with explorer.
    You can open the document library1 in explorer then copy the files which you want to paste to another site collection
    document library2, then open the document library2 in explorer to paste the documents.
    Besides, there are other method:
    https://social.msdn.microsoft.com/Forums/office/en-US/67282348-25c7-4bd0-9d95-61024c6892f9/how-we-move-a-document-library-from-one-site-collection-to-another-sitecollection?forum=sharepointgeneralprevious
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/8c112d85-1ab8-426b-be37-d010cf8647fe/copy-a-list-from-one-site-collection-to-another-using-web-service
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Create a new site collection in different farm and connect to different content database from decommissioned farm

    I wish to bring down a SharePoint farm1 and create a new site collection in an existing farm2 and connect the new site collection in farm2 to the content db in farm1.
    Is this possible and how should I do it?

    it is possible to copy/move a content database from one farm to another... so long as the NEW farm is at least as up-to-date (version/service packs/updates/hotfixes/etc) as the OLD farm.
    you can move a site collection into its own content database.
    hopefully that answers your question.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Existing SharePoint 2010 Content Database Attach – No Site Collections

    First, let me start off by saying that I have read every single thread I could find on this subject, such as:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/0c34ca6f-0db1-4d61-a48c-c4704dd86513/currentsitecount-is-zero-in-upgraded-site
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/502459b3-0301-4ac3-bfc4-16ea702bb5bc/empty-site-data-after-mounting-content-database?forum=sharepointadminprevious
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/ec472ed5-4cdd-45ca-a327-ccc34c29c0a4/zero-site-collections-when-restoring-sp2010-content-database?forum=sharepointgeneralprevious
    http://social.technet.microsoft.com/Forums/en-US/c8df1760-275a-43a4-b3fc-cf257c56d8e2/orphaned-entry-in-config-database
    That said, even though my situation is a bit different than those posts, I have tried all the things!
    Let me break it down:
    Our prod server is a sad Frankenstein upgrade from Project/SharePoint 2003 to 2007 to 2010. 
    The problem is not on our prod server.
    Our test server was a database attach installation.  It mostly works. 
    The problem is, we have this old content database which housed the project sites that were created on 2003, then upgraded to 2007, then upgraded to 2010 – but when it attaches to the test server, it's empty.  The "current number of site collections"
    in CA shows 0 and the CurrentSiteCount in powershell = 0.
    We have to keep these sites and their links for compliance reasons (7 year retention policy!) and we haven’t really cared that they aren’t working on the test server…except that we are going to be upgrading to 2013 this year, and that’s a database attach
    no matter what.  So I have to solve this now.
    I’ve checked the following:
    The data is there on the database.
    The database name I’m typing is correct.
    The version of the db is up to date.
    The top level site is set to Exclusion.
    Permissions.
    Here’s what I’ve tried:
    Attaching using powershell
    Attaching using Central Admin
    Detaching and reattaching
    Running psconfig
    Resetting IIS
    When the database is unattached, I have tried the “Recover data from an unattached content database” function – it recognizes the database (if I type it in wrong, it tells me I don’t have access) but then finds nothing in the site collections.
    The prod server is perfectly happy with these sites, and we copied the database from prod after the 2010 upgrade, so I don’t know what the issue is.
    I appreciate any thoughts any of you have.  I’m stumped!
    ElliJ 
    Project Solutions Specialist
    http://projectserverpants.wordpress.com/

    Holy lots of errors, batman!!
    I think it's safe to say that the 2010 upgrade didn't hit all our sites, based on the errors and this post:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/c7b19345-3036-4dc1-a174-026796cdee7c/missing-server-side-dependencies-after-project-server-upgrade-from-2003-to-2010?forum=projserv2010setup
    There are serveral missing setup files and one missing assembly:
    Category        : MissingSetupFile
    Error           : True
    UpgradeBlocking : False
    Message         : File [1033\PWA\lists\wplib\dwp\Updates.dwp] is referenced [27
                      5] times in the database [STS_FSHAREPTP01_1], but is not inst
                      alled on the current farm. Please install any feature/solutio
                      n which contains this file.
    Remedy          : One or more setup files are referenced in the database [STS_F
                      SHAREPTP01_1], but are not installed on the current farm. Ple
                      ase install any feature or solution which contains these file
                      s.
    Category        : MissingAssembly
    Error           : True
    UpgradeBlocking : False
    Message         : Assembly [Microsoft.Office.Project.Server.PWA,Version=12.0.0.
                      0,Culture=neutral,PublicKeyToken=71e9bce111e9429c] is referen
                      ced in the database [STS_FSHAREPTP01_1], but is not installed
                       on the current farm. Please install any feature/solution whi
                      ch contains this assembly.
    Remedy          : One or more assemblies are referenced in the database [STS_FS
                      HAREPTP01_1], but are not installed on the current farm. Plea
                      se install any feature or solution which contains these assem
                      blies.
    I guess the question now is - how do we get it to upgrade ALL of the site collections and sites?  I'm actually pretty sure I can figure it out from here, that test was a huge help, thanks!

  • Alerts are not working for Site collections in a content database

    Hi,
    We have been into a strange issue that alerts are not working for site collections from a particular content database. When user subscribed for the alerts, they are getting mail about their subscription but not after that for any new items/documents added
    or changes happen in the list/document library.
    We have tried with Immediate as well as scheduled alerts both are not working.
    FYI, Alerts for all other site collections from different content database for the same web application are working without any issues.
    Any help would be appreciated.
    Thanks
    Ramkumar

    Looks like an Timer job Issue for your web application. Can you please check if these jobs are enabled and check error log for the alerts Timer jobs .Check whether the "Immediate Alerts" job is enabled for your web application.
    job-immediate-alerts
    job-daily-alerts
    job-weekly-alerts
    Please check this wiki -
    Troubleshooting Steps for SharePoint Alert Email Does Not Go Out
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • Workspace Project Custom Field Web Part on different Site Collection?

    Hello experts,
    I'm working on a project site template in a SharePoint 2010 environment. My client wants project custom fields to be displayed on the Project Site homepage.
    To accomplish this, I'm using the Solution Starter's Workspace Project Custom Field Web Part.
    It works fine, as long as we create the project sites under the PWA site collection.
    However, due to administrative reasons, we've decided to provision all project sites under a separate Site Collection, in a separate content database. In this case, we manage to add the webpart to the page, but as soon as we try to edit it, to configure
    the visible Custom Fields, we get this error:
    Server Error in '/' Application.
    Unhandled Communication Fault occurred
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Web.Services.Protocols.SoapException: Unhandled Communication Fault occurred
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [SoapException: Unhandled Communication Fault occurred]
    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +413241
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +300
    WorkspaceProjectCFWP.WebSvcCustomFields.CustomFields.ReadCustomFieldsByEntity2(Guid entityUid) +181
    WorkspaceProjectCFWP.Services.<>c__DisplayClass12.<GetCustomFields>b__11() +158
    Microsoft.SharePoint.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2() +729
    Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) +26839062
    Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) +27885657
    Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) +93
    WorkspaceProjectCFWP.Services.CustomFieldsService.GetCustomFields() +208
    WorkspaceProjectCFWP.Services.CustomFieldsService.GetAllProjectFields() +173
    WorkspaceProjectCFWP.ProjectCFEditorPart.SyncChanges() +325
    Microsoft.SharePoint.WebPartPages.ToolPane.OnSelectedWebPartChanged(Object sender, WebPartEventArgs e) +283
    System.Web.UI.WebControls.WebParts.WebPartEventHandler.Invoke(Object sender, WebPartEventArgs e) +0
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.BeginWebPartEditing(WebPart webPart) +96
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.ShowToolPaneIfNecessary() +579
    Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) +296
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Page.OnInitComplete(EventArgs e) +11146206
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1674
    Version Information: Microsoft .NET Framework Version:2.0.50727.5472; ASP.NET Version:2.0.50727.5474 
    Now, I've activated every possible feature, both on the Site Collection and Site level (or SPSite, SPWeb). Alas, no succes. Which brings me to these questions:
    What might be causing this error? Can this be solved?
    Are there any cases of working webparts of this kind in site collections other than PWA?
    If this is a technical limitation, what are alternative options for me to display custom fields on a project site?
    Link to the Solution Starters: http://archive.msdn.microsoft.com/P2010SolutionStarter

    Hi
    I did not use this solution starter, but it might be that the webpart just looks for a Project Server instance in the current site collection - and there is none.
    You could use a SQL Reporting Services Report to show on the site to accomplish this. Either you would have to set the project as a parameter manually once for each site, or you could try to determine the project automatically using the URL.
    Kind regards
    Christoph
    Christoph Muelder | Senior Consultant, MCTS, MCSE, MCT | SOLVIN information management GmbH, Germany

  • Delete sitecollection with content Database programaticaly

    Hi All,
    I have created Site collection with separate content database by  programmatically.
    in the same manner
    1) I want to delete the site collection and it's Content database.
       or
    2)User wants to delete the site collection from settings , after deleted the sitecollecton from settings page then it's content db not deleted.
    how can user can delete the site collection content db from user interface(user means - admin user, have full permission)
    Please assist on this.
    Thanks in advance.

    Regarding #2, when a site collection is deleted, SharePoint will NEVER delete the content database as well... SP has no way of knowing whether the CDB will be used for other site collections in the future, and CDB maintenance is an ADMIN task, not a USER
    task.
    Delete the content database with SPSite.ContentDatabase.Delete() - more or less
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Upgrade large farm with Service Pack detaching all content databases?

    Hi,
    Whenever we upgrade one of our farms (with a Cumulative Update, Language Pack, or Service Pack), the corresponding PSConfig usually yields in error due to the huge time taken to upgrade all the content databases at the same time.
    We have heared about the possibility of detaching all content databases previous to the update (just CONTENT databases), then proceed with the installation and PSConfig, and finally a gradual upgrade by attaching one by one the content databases.
    After searching online I have not found a relevant or precise official documentation detailing whether this procedure is recommended or viable, and have some additional questions:
    - Can all he content database be disconnected (including the ones containig myprofiles, top level sites...) during the upgrade?
    Thanks in advance

    In my understanding, the patching involves (at least) two steps:
    Patching binaries on all servers of the farm
    Upgrading the database schema of Service Applications DBs, Configuration & Admin DBs, and content databases.
    If during the upgrade the database is not attached to the farm, SharePoint does not know about it, and does nothing with itm just like if it was physically detached from the SQL Server instance. But when, after patching, you reattach the database, SharePoint
    detects the difference in the schema version and the patched farm version, and upgrades the database accordingly. As far as I understand, this is automatically done by
    Mount-SPContentDatabase:
    "The Mount-SPContentDatabase cmdlet attaches an existing content database to the farm. If the database being mounted requires an upgrade, this cmdlet will cause the database to be upgraded.
    The default behavior of this cmdlet causes an upgrade of the schema of
    the database and initiates upgraded builds for all site collections within the specified content database if required. To prevent initiation of upgraded builds of site collections, use the
    NoB2BSiteUpgrade parameter. This cmdlet does not trigger version-to-version upgrade of any site collections."
    If you decide not to upgrade, you can later run Upgrade-SPContentdatabase.
    The point is, that if you keep attached all the content databases, the PSConfig needs to do a massive upgrade of all the content databases before finishing, thus considering that the farm is ok. On the detach/attach approach, the first PSConfig ends quite
    soon so your farm is up and running sooner (although, that's for sure, without the data being available until attached and upgraded - but you can gradually start giving service instead of waiting for the whole process).
    So far, so good. But what I was trying to ask in my question, is whether there is a detailed procedure to follow for this approach, or if there is any particular constraint regarding this approach (like "databases containing top level site collections
    should not be detached", or "pay attention to the my site host web application", or "that patching method is not supported").
    Thanks.

  • Want to restore recent production backup content db into Dev Farm but both contain the same site collections.

    Here is my scenario: 
    My current dev sharepoint 2013 environment is using a former backup of Production (which is 2010). We need to restore the latest backup from production into the dev environment. I restored the production backup to a new database under a different name. When
    I use "Mount-spContentDatabase" and point towards the latest production backup under a new name it gives me the error:
    Mount-SPContentDatabase : The attach operation cannot continue because another
    object in this farm already contains the same ID. Each object in a farm must
    have a unique ID. In order to proceed with the attach operation you must
    assign a new ID to this database. To attach this database with a new ID, use
    the Mount-SPContentDatabase command with the -AssignNewDatabaseId parameter.
    Note that if this new database and an existing database contain the same site
    collections, attaching this database will likely result in orphaned site
    collections due to conflicts between the two databases." 
    I realize mounting the same content db's in one farm leads to a duplication of database and site collection GUIDS in the sql database. I guess my question is what is the easiest way to restore a content db with the same site collections and ID. 
    Should I "disconnect" the current dev content db, take a backup of it, delete it from sql server, and then mount the newest production backup or will that still give me the same "orphaned" site issue?
    Should I do the above, delete the web application, create a new one and then try to mount latest production backup?
    If someone could give me specifics on how this can be accomplished short of installing on a new farm that would be much appreciated!

    Once you detach it from Sharepoint, so all the site information gone from Config DB. No need to delete it from SQL but you can if you need free space on the SQL.
    After detaching old DB from sharepoint and mount the new DB to web application...you will not get the ID error.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Create a site collection with dedicated content db with the help of server object model

    Hi,
     I have a requirement to implement a create a new site collection with dedicated content db. i have got 2 PowerShell scripts which does the same. first i will  create a content  db and then create the sitecollection with contentdb
    parameter with the created contentdb name.
    Now the site collection created must contain few doc libs and few splists with look up columns, people picker data type, multiline of text, single line of text,choice field. hence i am thinking the below approach:
     1) create a web template and include sp doclibs, splists , site columns in this.
     2) i am thinking of a ui design to create the below:
     These are called "projects" which is actually the site collection with the doclibs, splists and must be created by sharepoint admin on click of a link in my landing page.end users access these "projects"  aka 
    "site collections" and uploads the documents into these projects and collaborate.
    so my question is :  On click of a button can I create a site collection with a dedicated content db based on the web template created with the  hel of  server  object model?
    The other approach is on click of this button call the power shell script which accepts the sitecollection name and contentdb name as parameter. is this possible in  server obj.model ?
    passing a paramter from code behind- visual web part ui to power shell ?
    and it should create the site collec based on the web template and create the content db.
    my doubt #3 : will it not throw error "request timed out" when creating the site collec and contentdb from ui ?

    Try below:
    http://sharepoint.stackexchange.com/questions/21606/programmatically-create-a-site-collection-in-an-existing-mounted-content-databa
    PowerShell is just a wrapper for the object model. You shouldn't need to reference PowerShell in your feature, just create the new site collection with C# inside your feature. There's a blog post here that illustrates some code that may get you started.
    http://blog.mastykarz.nl/programmatically-creating-sites-site-collections-custom-web-template/
    http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx
    # Enable the remote site collection creation for on-prem in web application level
    # If this is not done, unknon object exception is raised by the CSOM code
    $WebApplicationUrl = http://dev.contoso.com
    $snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
    if ($snapin -eq $null)
    Write-Host "Loading SharePoint Powershell Snapin"
    Add-PSSnapin "Microsoft.SharePoint.Powershell"
    $webapp=Get-SPWebApplication $WebApplicationUrl
    $newProxyLibrary = New-Object "Microsoft.SharePoint.Administration.SPClientCallableProxyLibrary"
    $newProxyLibrary.AssemblyName = "Microsoft.Online.SharePoint.Dedicated.TenantAdmin.ServerStub, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
    $newProxyLibrary.SupportAppAuthentication = $true
    $webapp.ClientCallableSettings.ProxyLibraries.Add($newProxyLibrary)
    $webapp.Update()
    Write-Host "Successfully added TenantAdmin ServerStub to ClientCallableProxyLibrary."
    # Reset the memory of the web application
    Write-Host "IISReset..."
    Restart-Service W3SVC,WAS -force
    Write-Host "IISReset complete."
    If this helped you resolve your issue, please mark it Answered

  • Content Database Growing too large

    We seem to be experiencing some slowness on our SharePoint farm and noticed that one of our databases (we have two) is now at 170 Gb. Best practice seems to be to keep the database from going over 100Gb.
    We have hundreds of Sites within one Database and need to spit these up to save space on our databases.
    So I  would like to create some new databases and move some of the sites from the old database over to the new databases.
    Can anyone tell me if I am on the right track here and if so how to safely move these sites to another Content Database?
    dfrancis

    I would not recommend using RBS. Microsoft's RBS is really just meant to be able to exceed the 4GB/10GB MDF file size limit in SQL Express. RBS space /counts against/ database size, and backup/restore becomes a more complex task.
    Trevor Seward
    Follow or contact me at...
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Strange behavior from script when dismounting content databases via PowerShell script

    So, this is my first time posting a question here.  I have taught myself PowerShell and for the most between friends, co-workers, or internet forums, I have been able to pick through most of the issues I have seen.  This one has me stuck. 
    So, a little background, I have a script that goes through each web app in a farm, finds the database that hosts the root site, and detaches all other content databases from the farm.  It also writes a csv file so that a process can come along after the
    fact to re-attach the databases.  I use this for patching so psconfig does not take quite as long as we have more than 50 content databases.  Here is the odd part.  After the first content database is detached, the second one is skipped, but
    the remainder are detached.  So, I have two databases left per web app.  One that holds the root site and whatever the second database is after the first detach.  If I comment out the line that actually does the detach, this does not happen. 
    Now, using ISE and adding break points, what I have found is that when I initially populate the array with the content databases ($var=$webapp.contentdatabase) all databases are in there.  When I start the foreach, all databases are in there.  Right
    up to the point that I detach the first database, all databases are still in the array variable.  As soon as I detach that database, the database that I detached gets removed from the array.  It does this even if I set the variable to read only. 
    It only happens with the first database detached in each web app.  I will try to explain this again with an example.  This test farm has 4 databases.  DB1, DB2, DB3, and DB4.  DB1 holds the root site.  The logic pulls the webapp info. 
    It gets the URL of the webapp.  It takes that info and finds the site collection with that name (the root site).  Finds the database name from there.  It then gets a list of all databases in the webapp and starts to loop through.  So the
    first one in the list is DB1.  It has the root site, so logic says do not delete.  It comes back to the loop with the next database DB2.  At this point, the array still has all 4 databases in the array.  DB2 does not host the root site,
    so the logic gathers information and calls dismount-spcontentdatabase.  As soon as that is called, that database is removed from the array.  So, at this point, we have processes postion 0 and position 1 in the array.  Since the original position
    1 has been removed, DB3 is now at postion 1.  So, the loop continues.  Sine we have now skipped DB3, we find DB4 and dismount.  Now, we have in the array DB1,DB3, and DB4.  My test environment has more and all are still there except for
    the first one removed.  I have banged my head against the desk with this one.  If someone has some insight, I would appreciate it.
    Here is the code that does it.
    get-spwebapplication | foreach-object {
     $webapp=$_
     $waname=$webapp.displayname
     $waurl=$webapp.url
     $cdbs=$webapp.contentdatabases
     $rsite=get-spsite $waurl -erroraction silentlycontinue
     $rsitedb=$rsite.contentdatabase
     $rsitedbn=$rsitedb.name
     foreach ($cdb in $cdbs) {
      $cdbs=$cdbs2
      $cdbname=$cdb.name
      #Write-Host "$cdbname" -foregroundcolor red
      if ($cdbname -ne $rsitedbn) {
       $warn=$cdb.warningsitecount
       $max=$cdb.maximumsitecount
       $current=$cdb.currentsitecount
       $dbserver=$cdb.server
       Write-output "$waname,$cdbname,$dbserver,$warn,$max,$current" >> $outfile
       Write-host "dismounting $cdbname" -foregroundcolor green
       dismount-spcontentdatabase -identity $cdbname -confirm:$false
      else {
       Write-host "$cdbname holds root site. No action." -foregroundcolor yellow

    what about keeping an array of all the non-root collections (may be database name) instead of dismounting them in the foreach loop of all the databases? After we have all the databases that need to be deleted, in a for loop starting with 0 and
    counting to the number of databases, check the name of the database for each index and dismount that database
    pseudo code would be
    $dbstobedismounted = @()
    foreach($cdb in $cdbs)
    $dbstobedismounted + = $cdb.Name  //instead of actually dismounting
    for(int i=0;i<$webapp.ContentDataBases.Count;i++)
    $dabasename = $webapp.ContentDataBases[i].Name
    foreach($dbtobedismounted in $dbstobedismounted)
    if($databasename -eq $dbtobedismounted )
    dismount-spcontentdatabase -dentty $webapp.ContentDataBases[i]
    I'm sure you might have to do some modifications to make it work, but the point I'm making is instead of dismounting in the foreach loop, have a list and dismount in another for loop. Hope it helps.
    rani

  • Search content from seperate Content Database using Scope

    Hi there,
    I am asked to move all non-active old sites to a seperate Archive Content Database (ACDB). Management don't want to see any content from ACDB. If required to search content from ACDB, scope should be used anywhere in the webapplication to search only from
    ACDB.
    I am thinking to create a Archive Content DB and move all non-active site collection to it. Create a scope and make it available to all site collections.
    Is it so simple of I am missing some more steps.
    Please advise.
    Thanks
    Mickey

    Hi Mickey,
    Your direction is right.
    One point that you need to note is that you need to create the scope in SharePoint Central Administration, then configure the scope displaying in site collections.
    More information about how to configure scopes in SharePoint 2010, you can refer to:
    http://www.surfray.com/blog/2013/06/17/how-to-configure-scopes-in-sharepoint-2010/
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • MS Access and Date

    I have a MS Access table which contains a Date tag on each record. I want to retrieve records based on: Today - 1 month or Today - 2 weeks etc. Can anyone tell me the syntax? Thanks

  • Upgrading from Powerbook to MacBookPro

    Hi! I have ordered a new MacBook Pro wish is replacing my Powerbook G4. Is there som fast way to get started with my new MacBookPro? Can I use Carbon Copy Cloner to clone my old and new computer?

  • Mail Archive

    We are a small office with about 15 macs of varying vintage all running OS X. Most have been upgraded to O.S.10.4 but one machine has escaped the net and is still running O.S. 10.3.9 (incorporating Mail 1.3.11). On this particular machine you can dra

  • Increase Bar width in Cluster Barchart?

    When I decrease the chart width the width of the bars decrease as well. How do I increase the width of the bars in a cluster barchart while decreasing the width of chart? I am trying to draw three bars. There is a lot of wasted white space on the cha

  • WHAT IS THE DEPRECIATION AREA

    WHAT IS THE DEPRECIATION AREA