microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
733 stars 243 forks source link

How do I use my own database? #395

Closed GreatScott000 closed 7 years ago

GreatScott000 commented 7 years ago

I have a custom that I want to change to an extension. I need it in the GB database. How can I get a GB into the VM to use? I have restored my DB, opened it in DEVENV and converted it. When I try and open it in the RTC I get: "The database has version 1060 which is not supported by this version of Microsoft Dynamics NAV Server. Please contact your administrator."

Can I use my own DB?

defr0std commented 7 years ago

Hard to say without more information. In what version of Nav was this database created? I can ask the platform team if there is any special upgrade needed.

GreatScott000 commented 7 years ago

What more information do you need? The error message in my original message is all NAV tells me. The database was created in NAV 2017 build 15052 (CU2). When the database was converted there was no company created in the database.

Here is the information from the application log: Server instance: DynamicsNAV100Test Category: Runtime ClientSessionId: 00000000-0000-0000-0000-000000000000 ClientActivityId: 00000000-0000-0000-0000-000000000000 ServerSessionUniqueId: 382ddc52-0cac-4095-a214-ac3c06d01af9 ServerActivityId: 34dd68c0-97c5-4bf1-8dd1-c99f6a0772b0 EventTime: 07/20/2017 07:48:58 Message (NavSqlException): The TEST database has version 1060 which is not supported by this version of Microsoft Dynamics NAV Server. Please contact your administrator. ExceptionStackTrace: at Microsoft.Dynamics.Nav.Runtime.NavSqlTenantPropertiesSync.CheckTenantDatabaseVersion(NavDatabase tenantDatabase) at Microsoft.Dynamics.Nav.Runtime.NavSession.Open(Boolean useUserPersonalization, Byte[] licenseToUse, Boolean allowAppsDisabledMode) at Microsoft.Dynamics.Nav.Service.NSService.OpenConnection(ConnectionRequest connectionRequest) at SyncInvokeOpenConnection(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) CallerStackTrace: at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass23_0.b1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PushPopCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass23_0.b1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.CreateNewSessionCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Boolean requireNavUser, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.CreateNewAdminSessionCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass23_0.b1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass9_0.b0() at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationDuration(Stopwatch stopWatch, Action action) at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationAction(Action action, NavSession session) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PerformanceCounterCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass23_0.b1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TlsClearCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>cDisplayClass23_0.b1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.MessageRpc.Wrapper.Resume(Boolean& alreadyResumedNoLock) at System.ServiceModel.Dispatcher.ThreadBehavior.ResumeProcessing(IResumeMessageRpc resume) at Microsoft.Dynamics.Nav.Runtime.NavSynchronizationContext.<>c__DisplayClass1_0.b__0(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch()

ProcessId: 6692 Tag: 00000HC ThreadId: 11

GreatScott000 commented 7 years ago

The structure of the $ndo$tenantproperty table in my database it is different than that in Demo Database. The column tenantversionno does not even exist in the Tenerife version of the Demo Database. In addition there are $ndo tables in the Demo Database that are not in converted copy of my database Demo Database: /** Object: Table [dbo].[$ndo$tenantproperty] Script Date: 20/07/2017 09:09:57 **/ CREATE TABLE [dbo].[$ndo$tenantproperty]( [tenantid] nvarchar NOT NULL, [license] [image] NULL, [encryptionkeyfilename] nvarchar NULL, [encryptionkeyhash] nvarchar NULL, [applicationversion] nvarchar NOT NULL, CONSTRAINT [PK$ndo$tenantproperty] PRIMARY KEY CLUSTERED ( [tenantid] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO

ALTER TABLE [dbo].[$ndo$tenantproperty] ADD DEFAULT (N'10.0.17609.0') FOR [applicationversion] GO

My Database /** Object: Table [dbo].[$ndo$tenantproperty] Script Date: 20/07/2017 09:10:32 **/ CREATE TABLE [dbo].[$ndo$tenantproperty]( [tenantversionno] [int] NOT NULL, [collation] nvarchar NULL, [tenantid] nvarchar NULL, [license] [image] NULL, [encryptionkeyfilename] nvarchar NULL, [encryptionkeyhash] nvarchar NULL, CONSTRAINT [PK$ndo$tenantproperty] PRIMARY KEY CLUSTERED ( [tenantversionno] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [Data Filegroup 1] ) ON [Data Filegroup 1] TEXTIMAGE_ON [Data Filegroup 1] GO

GreatScott000 commented 7 years ago

Okay, so if I have a company (default tenant) defined then convert my database to Tenerife, I don't get this error.

defr0std commented 7 years ago

Thanks for the update. It looks like the tenant schema is not synchronized. Could you try running the Sync-NavTenant powershell commandlet as described here?