"Cannot restore database" SOLVED

Hi,

I’m trying to restore a backup I made 2 nights ago but i get the error as shown in the screenshot below.
Any ideas?
The Database I am trying to restore is a fully activated v5 from my epos system , and trying to restore it to my laptop.

EDIT: Both are running Samba 5.1.57

Thanks

Your server is running SQL 2014 but your laptop is running SQL 2012.

Upgrade your laptop to SQL Express 2014.

1 Like

Downloaded the latest samba release and installed with SQL 2014, but I still get the same error?

The error is stating that the Database Engine is incompatible with your Database Backup.

The backup was created using SQL 2014, and you are trying to restore it to a machine that is running SQL 2012.

You need to install SQL 2014 on your laptop.

1 Like

Yep, downloaded Samba 5.1.58 and made sure SQL 2012 was unchecked and 2014 was checked. Let me do a full uninstall and fresh install just to make sure.

Okay, fully uninstalled, restarted then installed. Made sure 2014 was checked. Still getting the same error. Am i doing the wrong thing?

You need to uninstall 2012. It’s still connected to the 2012 db, obviously, based on the error msg.

2 Likes

Uninstalling SambaPOS will not uninstall the Database Engine. You will need to do that via Windows Programs and Features (Add/Remove Programs).

2 Likes

Ah, sorry guys. Thanks for the help to both of you. Uninstalling now.

:sweat_smile:

Anyone recommend a connection string to get back into Samba?

Tried
Data Source=(LocalDB)\v11.0;
and
Data Source=(LocalDB)\v12.0;

Both come up with connection string error on startup. Appears to be no SambaSettings file either that I can delete to reset like in v4.

SambaSettings.txt is located in the following location(s):

C:\ProgramData\SambaPOS\SambaPOS5
C:\Users\[USERNAME]\AppData\Roaming\SambaPOS\SambaPOS5

Post the error or a screenshot of the error.

C:\ProgramData\SambaPOS\SambaPOS5 folder is hidden by default you need to enable hidden folders to see it.

Okay, thanks.

Deleted the file in C:\ProgramData\SambaPOS\SambaPOS5 called SambaSettings. Now when I load up Samba I get this error message.

Log:

-----------------------------
[General Info]

Application: SambaPOS
Version:     5.1.58
Region:      en
DB:          SQ
Machine:     
User:        
Date:        20/02/2016
Time:        10:58

User Explanation:

said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Data.SqlClient.SqlException
Message:     Cannot create file 'C:\Users\Kamal\SambaPOS5.mdf' because it already exists. Change the file path or the file name, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Source:      .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn)
   at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.<UsingConnection>b__32()
   at System.Data.Entity.Infrastructure.DbExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
   at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute(Action operation)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act)
   at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript)
   at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
   at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
   at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
   at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
   at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState)
   at System.Data.Entity.Database.Create(DatabaseExistenceState existenceState)
   at Samba.Persistance.Data.Initializer.Create(CommonDbContext context)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf`1.<CreateInitializationAction>b__e()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
   at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
   at Samba.Persistance.Data.WorkspaceFactory.CreateReadOnly()
   at Samba.Persistance.Data.Dao.Count[T]()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
   at Samba.Presentation.Bootstrapper.InitializeShell()

-----------------------------

[Assembly Info]

mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 7 Home Premium
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 0
--FreePhysicalMemory = 5026612
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-
--Manufacturer = LENOVO
--Model = 4287CTO
--TotalPhysicalMemory = 8354250752
--UserName = 
-----------------------------

######################### E N D ##

Okay, finally got it working, read the logs and deleted the SambaPOS5.mdf files. Again, as @Jesse would say…trial and patience :slight_smile:

1 Like