Copied to clipboard

Flag this post as spam?

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


  • Eli 15 posts 95 karma points
    Jan 22, 2019 @ 02:39
    Eli
    0

    Maintaining Umbraco database file in git

    Hi,

    I am developing an Umnraco project, which obviously includes the Umbraco sdf database file. Currently this sdf file is part of my git repository (I assume it must be there). The problem is that I want to keep developing my Umbraco project, and deploy it to a site where my client can change its content. So if I'm developing and changing the sdf file accordingly, and my client does so as well, I can have some conflicts between the two versions of the sdf file.

    How should I handle it? How should my sdf file be part of my project? How can I develop on one side, and let the client to "develop" on the other, with having any conflicts?

    Cheers

  • Alexander Croner 71 posts 282 karma points
    Jan 22, 2019 @ 07:52
    Alexander Croner
    101

    Usually what I do is to NOT use the SDF file (SQL CE) and instead use localdb or a local database. Which wouldn't be version controlled.

    Then I use uSync to sync my propertys and such to disc. These files will be version-controlled and automatically adds it to a database on startup.

    If I want to install the site on a new database, I'll just empty the connectionstring and the UmbracoVersion-property. What'll happen on startup is that the install wizard will start, update the database to the right version and then uSync will add the necessary data propertys etc.

    Good luck!

  • Eli 15 posts 95 karma points
    Jan 22, 2019 @ 22:38
    Eli
    0

    Thanks Alex. What if I cannot use something different than the sdf file?

    Cheers

  • Alexander Croner 71 posts 282 karma points
    Jan 23, 2019 @ 07:50
    Alexander Croner
    1

    I think the procedure would be pretty much the same except that I would have two different databases, one for developing locally and then one in production.

    When publishing I wouldn't move any databases, just let the application connect to the production one instead, and let uSync add my document types and data properties etc.

  • John Bergman 483 posts 1132 karma points
    Jan 23, 2019 @ 17:44
    John Bergman
    1

    To add to the comments above, if you are going to use usync, make sure you understand that deletes are not tracked by default, so if that is important you will need to adjust the usync backoffice configuration.

    We also use the SSDT to create a database project and track/version control the schema.

    We do, typically keep a snapshot of the database right before a release in version control just in case we end up missing something; so far so good though.

  • Eli 15 posts 95 karma points
    Jan 24, 2019 @ 02:32
    Eli
    0

    So now I am using uSync. I have the clients database, and my developer database. These are not git tracked. But I have this strange issue. The client changed the content of a simple text-input in a certain page. I can see that these changes were tracked by git - the App_Data\umbraco.config file was changed. Then, I committed these changes and merged them to the branch I am working on. I can see that the App_Data\umbraco.config has changed as expected, and when I browse the page on my local machine, the change is there. But, when I log in to the Umbraco management console, and got to "Content" for changing this page content again, the change is not there. How come the umbraco.config has the change, the browser displays the change, but when in my Umbraco console the change is not there?

    It seems like Umbraco Backend uses data from Database, and Umbraco frontend shows data from App_Data\umbraco.config. Anyways, if the CMS content itself is saved only in DB, and uSync does not sync it - how can I still sync it between two different environments?

    Thanks!

  • Magnus Eriksson 122 posts 362 karma points
    Jan 24, 2019 @ 10:13
    Magnus Eriksson
    0

    Hi Eli,

    AFAIK, App_Data\umbraco.config is a sort of file cache generated from the DB when publishing. The frontend of the site reads from umbraco.config and the backoffice reads from the DB and when any changes are made in the content the umbraco.config is rewritten.

    Are you using uSync.ContentEdition to sync content? I never sync content but I don't think uSync.ContentEdition uses umbraco.config for the import, and the umbraco.config should not be in version control as it's just a snapshot of the latest content structure in the DB.

    Regards, Magnus

  • John Bergman 483 posts 1132 karma points
    Jan 25, 2019 @ 21:17
    John Bergman
    0

    App_Data\umbraco.config should not be stored in version control - as Magnus mentioned below it is a cache file from the content of the database

  • John Bergman 483 posts 1132 karma points
    Jan 24, 2019 @ 05:01
    John Bergman
    0

    What are your usync settings? Do you import changes automatically? Maybe you just need to click the import button on the usync dashboard?

    Also remember, the last change on the page wins, so if your client changed it, and then you changed it... your change supercedes the clients change

Please Sign in or register to post replies

Write your reply to:

Draft