There is no simple way to swap them around. The “Name” or Id/Primary key is stored in one column with all other custom data stored in another as JSON.
I made this utility to swap the data.
Some caveats:
If connection string is set in a shortcut as a command line parameter, open the shortcut that sets the desired database as the tool pulls the connection string from the settings file. If none of this makes sense, don’t worry and continue.
The field to store the old Name/Id/PK, etc. must be created before the tool is run.
Do not delete the old custom field prior to running the tool.
If the corresponding custom field is not found, the entity is skipped.
If the resulting update would yield an entity as null, empty, or white space, the entity is skipped.
BACKUP DATABASE BEFORE RUNNING TOOL
Skipped entities are logged, and an option to view the log after update, or later by clicking the “View Log” button. It will include the original entity name/id for you to then go and manually update in SambaPOS.
I’ve added an checkbox to update the ticket entities. It’s not default selected as changing the historical ticket data may run afoul of some regulatory compliance and custom data may not match current entity data (e.g. different delivery addresses).
You may need to unblock the executable before it will run - right click exe and select “Properties” then uncheck the block checkbox at the bottom of the dialog.
You will be prompted to install .NET 8 runtime if it’s not already.
Because It’s sketchy to run exes from random internet people, I’ve included the source code to inspect and/or build it yourself if you’re so inclined.
In this example, the Id of the entity will be changed to the custom field “Phone” and the old Id stored in the custom field “Name”.
That would indicate to me that whatever database currently configured in the settings does not have that table. Have you deleted the db? Are you running this on a new install?
You’ll have to configure SambaPOS to use whatever database you specify, then restore the backup. Once that is all done the connection string should be saved and the application will pick it up.