# SP 4 Compact SQL -\> SP 5 upgrade path

**URL:** <https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397>\
**Category:** V5 Question\
**Created:** [February 22, 2022, 8:48am UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397 "2022-02-22T08:48:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![telefunken](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@telefunken](https://forum.sambapos.com/u/telefunken)\
**Post date:** [February 22, 2022, 8:48am UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/1 "2022-02-22T08:48:58Z")

</div>

I’m trying to upgrade a SambaPOS 4 Compact SQL install to the latest SambaPOS 5 using MSSQL but haven’t been successful as of yet.

Automigrate doesn’t seem to work as SP 5 doesn’t recognize the SDF file. When I add the SDF file as a connectionstring the startup fails with the following errormsg:

Keyword not supported: ‘multipleactiveresultsets’.

I’ve tried creating a backup file using database tools but when I try to import the zip file into SP 5 I get an error message saying the target database type doesn’t match the source.

So is there anyway to migrate SP4 CE SQL to SP5 MSSQL?

---

<div class="post-metadata">

**Author:** ![Kevser](https://forum.sambapos.com/user_avatar/forum.sambapos.com/kevser/32/62992_2.png) [@Kevser](https://forum.sambapos.com/u/Kevser)\
**Post date:** [February 22, 2022, 11:24am UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/2 "2022-02-22T11:24:21Z")

</div>

Hello @telefunken

You can check these links below.

[https://kb.sambapos.com/en/2-2-7-database-upgrading-from-sambapos-v3-and-or-v4-to-v5/](https://kb.sambapos.com/en/2-2-7-database-upgrading-from-sambapos-v3-and-or-v4-to-v5/)

[https://kb.sambapos.com/en/2-1-3-b-transferring-data-from-local-db-to-sql-database/](https://kb.sambapos.com/en/2-1-3-b-transferring-data-from-local-db-to-sql-database/)

[https://kb.sambapos.com/en/2-1-3-a-sql-express-server-setup/](https://kb.sambapos.com/en/2-1-3-a-sql-express-server-setup/)

> [@SQL Express 2014 Installation - SambaPOS4 Database Setup - \[BONUS\] How to Convert from CE to SQL Express](https://forum.sambapos.com/t/sql-express-2014-installation-sambapos4-database-setup-bonus-how-to-convert-from-ce-to-sql-express/3363):
>
> Microsoft SQL Express 2014 [SQL Express 2014 Download Link](http://www.microsoft.com/en-us/download/details.aspx?id=42299) Versions Available Express 32BIT WoW64\SQLEXPR32\_x86\_ENU.exe Express 32BIT\SQLEXPR\_x86\_ENU.exe Express 64BIT\SQLEXPR\_x64\_ENU.exe ExpressAdv 32BIT\SQLEXPRADV\_x86\_ENU.exe ExpressAdv 64BIT\SQLEXPRADV\_x64\_ENU.exe ExpressAndTools 32BIT\SQLEXPRWT\_x86\_ENU.exe ExpressAndTools 64BIT\SQLEXPRWT\_x64\_ENU.exe LocalDB 32BIT\SqlLocalDB.msi LocalDB 64BIT\SqlLocalDB.msi warning - MgmtStudio 32BIT\SQLManagementStudio\_x86\_ENU.exe warning - MgmtS…

---

<div class="post-metadata">

**Author:** ![telefunken](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@telefunken](https://forum.sambapos.com/u/telefunken)\
**Post date:** [February 22, 2022, 11:33am UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/3 "2022-02-22T11:33:22Z")

</div>

Hi,

All those methods concern SQL LocalDB or MSSQL, Compact SQL works a bit differently. As I’ve mentioned:

> [@telefunken](#):
>
> Automigrate doesn’t seem to work as SP 5 doesn’t recognize the SDF file.

I’ve devised a workaround using SSMS and will post it shortly.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [February 22, 2022, 1:02pm UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/4 "2022-02-22T13:02:35Z")

</div>

You can’t upgrade compact edition it is impossible. You should rebuild your setup in a fresh v5 sql install

You will more than likely experience issues when trying to migrate that. It is best to rebuild it from a fresh database.

---

<div class="post-metadata">

**Author:** ![telefunken](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@telefunken](https://forum.sambapos.com/u/telefunken)\
**Post date:** [February 22, 2022, 6:34pm UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/5 "2022-02-22T18:34:31Z")

</div>

Like I’ve said, I already succeeded. I’ll write up a tutorial when I have the time.

---

<div class="post-metadata">

**Author:** ![markjw](https://forum.sambapos.com/user_avatar/forum.sambapos.com/markjw/32/9942_2.png) [@markjw](https://forum.sambapos.com/u/markjw)\
**Post date:** [March 1, 2022, 4:32pm UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/6 "2022-03-01T16:32:46Z")

</div>

There are already 2 tutorials on the forum on ways to convert Compact SQL to SQL Express (or LocalDB, which would be the same as still connects in SSMS):

> [@Converting Compact SQL database to SQL Express (script)](https://forum.sambapos.com/t/converting-compact-sql-database-to-sql-express-script/926):
>
> This collection of scripts will convert a Compact SQL (\*.sdf) database to SQL Express 2012 database and update SambaPOS to use the database. Requirements 1… SambaPOS should be working using the Compact SQL database -\> SambaPOS4.sdf 2… Install SQL Express 2012 exactly as documented [here](http://sambapos.org/wiki/doku.php/en/installing_sql_express_2012_for_sambapos_v3) - DO NOT follow step 4. Using SQL Express 2012. and do not run SambaPOS after installing SQL Express. 3… Locate SambaPOS4.sdf and place all of the files from the attached ZIP file into this location. The locat…

> [@How to migrate from SQL Compact Edition (sdf file) to SQL Server 2012 Express](https://forum.sambapos.com/t/how-to-migrate-from-sql-compact-edition-sdf-file-to-sql-server-2012-express/752):
>
> Below is a Step by step guide on how to migrate files from SQL Compact Edition to SQL Server 2012. Very useful if you have configured SQL Express 2012. For anyone need help configuring SQL Express 2012 for SambaPOS follow the simple steps on below link: [http://www.sambapos.org/en/content/installing-sql-express-2012-sambapos-v3](http://www.sambapos.org/en/content/installing-sql-express-2012-sambapos-v3) [Creating the migration file] Locate the file SambaPOS4.sdf file in SambaPOS folder in My Documents. Copy it and paste it on your C:\ drive. The file should be loca…

---

<div class="post-metadata">

**Author:** ![telefunken](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/t/71e660/32.png) [@telefunken](https://forum.sambapos.com/u/telefunken)\
**Post date:** [March 1, 2022, 8:29pm UTC](https://forum.sambapos.com/t/sp-4-compact-sql-sp-5-upgrade-path/25397/7 "2022-03-01T20:29:36Z")

</div>

Those didnt do it for me. Either SP just crashes due to data corruption or the tool doesn’t work. The database is at max so those tools probably aren’t designed with that in min. Probably due to them being outdated and a hell for dependencies.

I used this tool with SSMS to export the data. The tool is maintained and updated.

> **[GitHub - ErikEJ/SqlCeToolbox: SQLite & SQL Server Compact Toolbox...](https://github.com/ErikEJ/SqlCeToolbox)**
>
> SQLite & SQL Server Compact Toolbox extension for Visual Studio, SSMS (and stand alone) - GitHub - ErikEJ/SqlCeToolbox: SQLite & SQL Server Compact Toolbox extension for Visual Studio, SSMS...
