d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
246 stars 101 forks source link

Error with New-D365BacPac right out the gate #484

Closed fwilkinson closed 3 years ago

fwilkinson commented 3 years ago

Never had a problem with the command till now. Just installed D365FO.TOOLs on a new 10.0.13 DEV Vm and when running with the command (as admin):
New-D365Bacpac -ExportModeTier1 -BackupDirectory J:\MSSQL_BACKUP -NewDatabaseName Stripped -BacpacFile "J:\MSSQL_BACKUP\20201124_Stripped_10_0_4.bacpac" I get an "Invoke-SqlBackupRestore" error. Followed by what looks like an "invalid connection string" error. See below for full error. Not sure what I am doing wrong?

[01:25:58][Invoke-SqlBackupRestore] Something went wrong while doing backup / restore against the database. | Exception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while establishing a connect ion to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is n ot valid)"

fwilkinson commented 3 years ago

I had added the MaxParralelism=32 flag in my original command, I removed that and it looks like it is working.

Splaxi commented 3 years ago

Hi @fwilkinson

Are we talking about a LCS deployed VM or a downloaded VHD?

If we are talking about the latter, you will need to configure the a few things first.

My personal initial list of commands for any new VM:

Invoke-D365InstallSqlPackage (https://github.com/d365collaborative/d365fo.tools/wiki/How-To-Install-SqlPackage) Invoke-D365InstallAzCopy (https://github.com/d365collaborative/d365fo.tools/wiki/How-To-Install-AzCopy)

Add-D365WindowsDefenderRules (https://github.com/d365collaborative/d365fo.tools/blob/development/d365fo.tools/functions/add-d365windowsdefenderrules.ps1)

If the VM is in fact a VHD / Onebox (NON-LCS), I also run this: Set-D365SysAdmin (https://github.com/d365collaborative/d365fo.tools/blob/development/d365fo.tools/functions/set-d365sysadmin.ps1)

Please note that you might have to run the PowerShell session with "RunAsAdministrator": https://github.com/d365collaborative/d365fo.tools/wiki/Tutorial-Install-Administrator https://github.com/d365collaborative/d365fo.tools/wiki/Tutorial-Import-Module

Let me know if this doesn't get you going, so we can dig into your specific issue.

Splaxi commented 3 years ago

Removing the MaxParralelism could explain that you don't have the latest SqlPackage.exe installed / downloaded.

Sorry for the previous comment, I can see that I didn't fully read your second comment, that you got it working.

MaxParralelism should be configured with some caution, but generally I set it to 2 x CPU Cores on the VM.