d365collaborative / d365fo.tools

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

new-d365bacpac BACKENDDB value #409

Closed jeroeneikmans closed 4 years ago

jeroeneikmans commented 4 years ago

Hi,

When I make a database export in LCS of a Tier-2 environment, it generates a bacpac file. Inside that bacpac file the SYSGLOBALCONFIGURATION table the BACKENDDB value is set to 'SQLSERVER'. But when I make a database export using new-d365bacpac in Tier-1 environment, it generates a bacpac file with BACKENDDB value is set to 'SQLAZURE'. Why is this behaviour different?

As a result when I export using new-d365bacpac in Tier-1 environment and I want to import that same bacpac in another Tier-1 the value of BACKENDDB is not right.

Jeroen

Splaxi commented 4 years ago

Hi @jeroeneikmans,

Originally the process of creating a bacpac file from a Tier1, was only being used to prep it for a Tier2.

But the import process, if you are using the d365fo.tools for that also - should actually fix that value to be correct. But I just checked the code and can see we are missing that part.

May I ask why you don't use classic sql backup for moving the database between Tier1 environments? It is way faster than waiting for the bacpac process?

If you actually do the new bacpac cmdlet with -ExportOnly, then the bacpac file should work flawlessly against any other Tier1...

Splaxi commented 4 years ago

Let me rephrase my commet a bit, was on mobile earlier.

When you are using the New-D365Bacpac, the default behavior is that you want a bacpac file that is valid for a Tier2 environment. That was the original documentation from Microsoft, because customers / partners were using Tier1 as their initial GOLDEN CONFIG environment to save money.

We later got some requests for supporting the Tier1 to Tier1 export, which basically could be done faster and more simpler with classic SQL backup / restore between the environments, but the -ExportOnly parameter actually fixes that for you.

jeroeneikmans commented 4 years ago

Thanks for pointing me to the -ExportOnly parameter. I know sql backup/restore is faster. I'm trying to automate data movements between environments and LCS, and I feel like only using d365fo.tools for this. Can D365FO.tools be used for only export a .bak and not the bacpac?

Splaxi commented 4 years ago

I would argue that if you are confident enough to use the d365fo.tools, then you should be able to use the dbatools.io, which is also a powershell module.

Dbatools is way better to supporting the bak files, than we ever will.

I'm happy to help you with the cmdlets to get you going...

Splaxi commented 4 years ago

You can use dbatools to handle the backup / restore, while d365fo.tools is used to handle the movement of the files and do the other steps needed...