Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Weber 48 posts 123 karma points c-trib
    Aug 26, 2021 @ 12:24
    Jesper Weber
    0

    Unattended install not working on SQL CE

    Hi,

    We are using the unattended install feature on SQL server and it works fine.

    On some local environments we are using SQL CE and here it seems that the unattended install is not working.

    We are just getting the following exception, as if the unattended install was not enabled.

    A connection string is configured but Umbraco could not connect to the database
    
  • Alex Skrypnyk (skrypnyk.dev) 6064 posts 23316 karma points MVP 6x admin c-trib
    Aug 27, 2021 @ 11:19
    Alex Skrypnyk (skrypnyk.dev)
    0

    Hi Jesper

    The message says that the umbraco is not able to connect to the database if its SQLCE check that the site has the right permissions to access /app_Data folder

    Thanks, Alex

  • Jesper Weber 48 posts 123 karma points c-trib
    Aug 27, 2021 @ 14:03
    Jesper Weber
    0

    Hi Alex, thanks for the reply.

    If I remove the unattended install, the connectionstring and the ConfigurationStatus and runs through the stanard Umbraco installer, the Umbraco.sdf database file in the /App_Data folder is created successfull, so permissions should be right.

    When I start the application with the unattended install the database file is not created and then I get the above exception (which is correct since the database, don't exists).

    So my problem is why the database file is not created? Will the unattended install only create the database tables and not the database it self?

  • Sebastiaan Janssen 5002 posts 15248 karma points MVP admin hq
    Aug 28, 2021 @ 14:44
    Sebastiaan Janssen
    101

    Like with SQL Server, you'd need to provide a blank database to start with in the App_Data folder. You can download one here: https://github.com/nul800sebastiaan/LeChiffre/files/7070850/UmbracoEmptySqlCEDatabase.zip

    Though I would love to see a PR to fix this. Currently the behavior is to connect to the database, check if it has a schema, if not, then we can do an unattended install. This is where the code checks if it can connect: https://github.com/umbraco/Umbraco-CMS/pull/9482/files#diff-2f9348c423cf2afa192ef51f51832a4afec4f0303c8cf3a759f2b5c45cad825aR259

    Would be cool to have some code that checks if the provider name is System.Data.SqlServerCe.4.0 and if ~/App_Data/Umbraco.sdf doesn't exist that it creates the database.

  • Jesper Weber 48 posts 123 karma points c-trib
    Aug 31, 2021 @ 07:35
    Jesper Weber
    0

    Hi Sebastian, thanks for the reply.

    I got it working with the empty sql ce database :-)

    I might try to do a PR for this since it will be easier to work with. But it will also make the behaviour different for SQL CE and SQL Server if the database will be created for CE but not for SQL Server.

  • Sebastiaan Janssen 5002 posts 15248 karma points MVP admin hq
    Aug 31, 2021 @ 07:42
    Sebastiaan Janssen
    0

    Yeah we'd love to be able to create regular SQL databases as well but that would need an extra set of credentials. It's also a bit more complicated as you would probably want new credentials for each new database, which means you'll need to give the installer admin credentials to create a new user AND a database.. Gets complicated quite quickly.

    Obviously we use this for Cloud where we provision databases separately beforehand so we have a pool of connectionstrings to choose from.

    Ps. Just a reminder to not use SQLCE in production.. 🙈

  • Jesper Weber 48 posts 123 karma points c-trib
    Aug 31, 2021 @ 07:47
    Jesper Weber
    0

    It will surely be more complicated with SQL Server yes.

    And yes, we only use SQL CE on our local environments :-)

  • Jesper Weber 48 posts 123 karma points c-trib
    Aug 31, 2021 @ 11:58
    Jesper Weber
    0

    I created a PR to auto create the SQL CE database (https://github.com/umbraco/Umbraco-CMS/pull/10995) and another PR with a new setting indicating if the unattended.user.json file should be deleted or not during the unattended install (https://github.com/umbraco/Umbraco-CMS/pull/10996)

Please Sign in or register to post replies

Write your reply to:

Draft