Timeout error migrating large companies to multitenant
gilbert
Member Posts: 11
Hello,
I'm testing on migration of a database to a multitenant environment.
2"
I followed the steps in of Waldo's video (http://www.waldo.be/2013/09/16/nav2013r2-readiness/) , and everything worked well when the company is "small". When I tried to move a "large" company to a new database, the powershell cmdlet gives me a timeout error.
ie:
Get-NAVCompany DynamicsNAV71 -tenant Default | Where-Object { $_."CompanyName" -like "*COMPANYNAME*" }|howto-movecompanytotenant DynamicsNAV71 -FromDatabase 'NAV2013' -OldTenantName 'Default' -NewTenantName 'NEWDATABASE' -RemoveCompanyWhenMoved
Error:
Invoke-Sqlcmd : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
At C:\install\multitenancy\HowTo-MoveCompanyToTenant.ps1:146 char:9
+ Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -I ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
When I refresh the SQL Databases in Management Studio I can see the new Database, but the old-source database still contains the company tables.
I know I can avoid this error by setting the parameter-querytimeout, but do not know how to use this parameter with NAV cmdlets.
You can help me?
Thank you!
I'm testing on migration of a database to a multitenant environment.
2"
I followed the steps in of Waldo's video (http://www.waldo.be/2013/09/16/nav2013r2-readiness/) , and everything worked well when the company is "small". When I tried to move a "large" company to a new database, the powershell cmdlet gives me a timeout error.
ie:
Get-NAVCompany DynamicsNAV71 -tenant Default | Where-Object { $_."CompanyName" -like "*COMPANYNAME*" }|howto-movecompanytotenant DynamicsNAV71 -FromDatabase 'NAV2013' -OldTenantName 'Default' -NewTenantName 'NEWDATABASE' -RemoveCompanyWhenMoved
Error:
Invoke-Sqlcmd : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
At C:\install\multitenancy\HowTo-MoveCompanyToTenant.ps1:146 char:9
+ Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -I ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
When I refresh the SQL Databases in Management Studio I can see the new Database, but the old-source database still contains the company tables.
I know I can avoid this error by setting the parameter-querytimeout, but do not know how to use this parameter with NAV cmdlets.
You can help me?
Thank you!
0
Answers
-
Well, now I can answer to my self:
If you experience this error, you can avoid it modifying the HowTo-MoveCompanyToTenant.ps1 sample, adding "-querytimeout 0" parameter to the invoke sql sentence that moves the companies to the new tenant database:
Original: Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -InputFile $sqlFile -Variable $VariableArray
Modified: Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -InputFile $sqlFile -Variable $VariableArray -querytimeout 0
Save the ps1 file and call it from ps.
Bye!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions