Migrating Server Woes

I have successfully been running a 2 terminal and one server(my RnD laptop) system of V5 for a while. I want to move the Database Server to one of the desktop that is currently the terminal and buy a new license for it and keep the old license with the RnD laptop so that I can continue to develop more functions for it.

I install a copy SQLExpress 2014 in the terminal and set up the instance and db and so forth.
I use the file test-connection trick and it showed connection successful using both Windows and SQL login info.
I run the SambaPOS v5 which is still connected to the laptop server.
I changed the connection string to the new string pertaining to the information on the terminal’s newly installed SQLExpress 2014, the system responded to connection successful.
But once I click Apply, SambaPOS V5 pops out. Not sure is that a crash or what.
I reload SambaPOS V5, it gets stuck at the connection string screen claiming an error. I will provide screen shots later as I don’t like to run any internet browsers on the work machines.

I also tried to uninstall SambaPOS using the Windows uninstall UT, it seems to have removed the program pretty OK.
I reinstall SambaPOS V5 with an installation file from before.
When I load SambaPOS, it get stuck at the connection screen again, BUT isn’t that supposed to be a fresh install and should not have any old data, menus, rules, … and connection string?

Connection string is in the settings text file.

Menus and rules etc are in database.

Reinstalling samba without removing the settings file/program folder completely will put you back in exact same place as before uninstalling.

This doesnt answer why the connection string isnt working.
Without more info hard to say.
Check firewall and piped routes etc from SQL tutorial.
Migration is easy once sql etc is sorted - backup current database before moving and once connected to new SQL database just restore the backup.

Here are the screen shots that I think maybe related

Note the error message seems to indicate there are conflicts in some rules, actions, scripts…or such of the importing of the database

Note that old system is still function without any issue with the rules, actions,…
so I will include the log file here`LFC-Operator said “”

[Exception Info 1]

Top-level Exception
Type: System.Exception
Message: An error occured executing the following sql:
ALTER TABLE [dbo].[Payments] ADD [TenderedAmount] DECIMAL(16,2) NOT NULL CONSTRAINT [DF_Payments_TenderedAmount] DEFAULT 0
The error was Cannot find the object “dbo.Payments” because it does not exist or you do not have permissions.

Source: FluentMigrator.Runner
Stack Trace: at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String sql)
at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.Process(String sql)
at FluentMigrator.Runner.Processors.ProcessorBase.Process(CreateColumnExpression expression)
at FluentMigrator.Expressions.CreateColumnExpression.ExecuteWith(IMigrationProcessor processor)
at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass1f.b__1c()
at FluentMigrator.Runner.MigrationRunner.AnnounceTime(String message, Action action)
at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection1 expressions) at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action2 getExpressions)
at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean useAutomaticTransactionManagement)
at FluentMigrator.Runner.MigrationRunner.MigrateUp()
at FluentMigrator.Runner.Initialization.TaskExecutor.Execute()
at Samba.Persistance.Data.Migrator.DoMigrate(String connectionString)
at Samba.Persistance.Data.Migrator.DoMigrate(CommonDbContext context)
at Samba.Persistance.Data.Initializer.Migrate(CommonDbContext context)
at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<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.RetryAction1.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.Infrastructure.Data.SqlData.EFWorkspace…ctor(CommonDbContext context)
at Samba.Persistance.Data.WorkspaceFactory.Create()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.get_Workspace()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type: System.Data.SqlClient.SqlException
Message: Cannot find the object “dbo.Payments” because it does not exist or you do not have permissions.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String sql)


[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
Samba.Services, Version=1.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
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
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
FastButton, Version=1.0.0.0


[System Info]

Operating System
-Microsoft Windows 10 Home
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = -240
–FreePhysicalMemory = 1951872
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.14393

Machine
-HOMENOVA-LFC-1
–Manufacturer = LENOVO
–Model = 90FN006NUS
–TotalPhysicalMemory = 4201500672
–UserName = HOMENOVA-LFC-1\LFC-Operator


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

[General Info]

Application: SambaPOS
Version: 5.1.62
Region: en
DB: SQ
Machine: HOMENOVA-LFC-1
User: LFC-Operator
Date: 5/15/2017
Time: 8:10 PM

User Explanation:

LFC-Operator said “”

[Exception Info 1]

Top-level Exception
Type: System.Exception
Message: An error occured executing the following sql:
ALTER TABLE [dbo].[Payments] ADD [TenderedAmount] DECIMAL(16,2) NOT NULL CONSTRAINT [DF_Payments_TenderedAmount] DEFAULT 0
The error was Cannot find the object “dbo.Payments” because it does not exist or you do not have permissions.

Source: FluentMigrator.Runner
Stack Trace: at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String sql)
at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.Process(String sql)
at FluentMigrator.Runner.Processors.ProcessorBase.Process(CreateColumnExpression expression)
at FluentMigrator.Expressions.CreateColumnExpression.ExecuteWith(IMigrationProcessor processor)
at FluentMigrator.Runner.MigrationRunner.<>c__DisplayClass1f.b__1c()
at FluentMigrator.Runner.MigrationRunner.AnnounceTime(String message, Action action)
at FluentMigrator.Runner.MigrationRunner.ExecuteExpressions(ICollection1 expressions) at FluentMigrator.Runner.MigrationRunner.ExecuteMigration(IMigration migration, Action2 getExpressions)
at FluentMigrator.Runner.MigrationRunner.ApplyMigrationUp(IMigrationInfo migrationInfo, Boolean useTransaction)
at FluentMigrator.Runner.MigrationRunner.MigrateUp(Boolean useAutomaticTransactionManagement)
at FluentMigrator.Runner.MigrationRunner.MigrateUp()
at FluentMigrator.Runner.Initialization.TaskExecutor.Execute()
at Samba.Persistance.Data.Migrator.DoMigrate(String connectionString)
at Samba.Persistance.Data.Migrator.DoMigrate(CommonDbContext context)
at Samba.Persistance.Data.Initializer.Migrate(CommonDbContext context)
at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<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.RetryAction1.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.Infrastructure.Data.SqlData.EFWorkspace…ctor(CommonDbContext context)
at Samba.Persistance.Data.WorkspaceFactory.Create()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.get_Workspace()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.ShouldCreateData()
at Samba.Presentation.Services.Common.DataGeneration.DataCreationService.CreateData()
at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type: System.Data.SqlClient.SqlException
Message: Cannot find the object “dbo.Payments” because it does not exist or you do not have permissions.
Source: .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at FluentMigrator.Runner.Processors.SqlServer.SqlServerProcessor.ExecuteNonQuery(String sql)


[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
Samba.Services, Version=1.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
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
Microsoft.Practices.Prism, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.13.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
FastButton, Version=1.0.0.0


[System Info]

Operating System
-Microsoft Windows 10 Home
–CodeSet = 1252
–CSDVersion =
–CurrentTimeZone = -240
–FreePhysicalMemory = 1944608
–OSArchitecture = 64-bit
–OSLanguage = 1033
–ServicePackMajorVersion = 0
–ServicePackMinorVersion = 0
–Version = 10.0.14393

Machine
-HOMENOVA-LFC-1
–Manufacturer = LENOVO
–Model = 90FN006NUS
–TotalPhysicalMemory = 4201500672
–UserName = HOMENOVA-LFC-1\LFC-Operator


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

The new db definitions

Where is the text file that contains the settings? I deleted the whole folder \Documents\SambaPOS5 after I uninstall.

You can change the settings in that popup.
Its usually in the samba folder in my documents I think…

How have you moved the database?
Or have you just made a database called sambapos?

Just connect samba to a new database by setting a different database name. and use the backup/restore method to move the system.

That is it! I added a db called SambaPOS5 myself(due to some prior reasons that I forget why) rather than letting Samba does its work. Now it is set to unregistered and when I backup from zip, it is working on the new connection. So I am ready to buy a new license for this one.

Thanks for the hint from your question.

However, I still want to find out where the connection string is stored as I have removed the whole folder in documents and I don’t seem to find anywhere else that has “Samba…” as a filename or folder.

In the programs folder would be other posible place.

The SambaSettings.txt file is located in one or both of the following locations, both of which are HIDDEN by default, depending on your install:

C:\ProgramData\SAMBAPOS\SambaPOS5

C:\Users\USERNAME\AppData\Roaming\SambaPOS\SambaPOS5

The log.txt file is located in the Windows User’s Documents path:

C:\Users\USERNAME\Documents\SambaPOS5