Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Business Central forum

Is there a way for a SchemaUpdate without removing data?

(0) ShareShare
ReportReport
Posted on by

Hi,

Whenever I change a field name or data type I always need to schema update. Is there a way for to update schema without deleting all the data so I don't have to do all the setup and data again?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,025 Moderator on at
    RE: Is there a way for a SchemaUpdate without removing data?

    What do you mean by change feed?

  • Nan Cheng Profile Picture
    5 on at
    RE: Is there a way for a SchemaUpdate without removing data?

    Hi,

    I just want to follow up on this question. Because I notice that whenever there is schema changes, it will delete all historical ChangFeed data and start adding changeFeed using new schema, which would be very hard for us to keep track of the changing history. Just wondering if the feature to retain data has been published?

    Thanks,

    Nan

  • yannstlo Profile Picture
    116 on at
    RE: Is there a way for a SchemaUpdate without removing data?

    Thanks Stefano.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Is there a way for a SchemaUpdate without removing data?

    You should use schemaUpdateMode = Recreate only if the version of your app that you want to push has breaking changes compared to the actually installed version, otherwise Synchronize or ForceSynch will preserve your data.

    If you’re forced to use Recreate then you could export data with Rapidstart and then import then later.

  • yannstlo Profile Picture
    116 on at
    RE: Is there a way for a SchemaUpdate without removing data?

    Hi Stefano,

    We are on v13 and still in development stage / implementation state. We've created multiple servers for our dev team and 1 for that will be the production machine. The production machine as 2 companies on it. 1 is the master that we will go live with and the other is a training companies where employees are entering data and testing different scenarios.

    I would like to push my latest version of our extensions to the prod server but would love to backup what has been entered so that the schemaUpdate=recreate does not delete all the hard work. Is it possible via code or some other way?

    Thanks

    Yann

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at
    RE: Is there a way for a SchemaUpdate without removing data?

    Actually, if you use schemaUpdateMode = Recreate you loose all the data.

    In the Spring release it will be available the new ForceSynch schema update mode. It’s very similar to the existing ‘Synchronize’ schema update mode but with more freedom to make schema changes while retaining data. Data will be preserved in almost all cases. The only exception is changing the main table's Primary Key in which case the data from the extension tables will be lost.

    Field renames are allowed and supported in this mode, but the data can only be preserved if you maintain the same ID. If you change both the name and the ID of the field than data will be lost.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans