Developer forum

Forum » Development » Swift update - braking changes on database?

Swift update - braking changes on database?

Karol Barkowski
Reply

Hi,

I just tried to update my website to use latest Swift version (from 1.21.0 to 1.26.4). I'm on DW version 9.17.6

I've noticed that there's quite a lot of database changes in swift item types. So, what is the recommended approach to update the database? I cannot just grab the demo website and overwrite my existing databse as of course I'd lose all my content and I'd have to start from scratch with the website. So that's not an option.
I tried to just delete all the tables that start with ItemType_Swift and make DW recreate them at startup. And it does, but again that means that I've just lost all the data that were there so my website won't even start.
I also tried to use the schema comparison tool and comppared a default Swift db with mine. It picked up all the differences and generated schema update scripts. But I get a ton of errors from that as well as it complains that would be a "data loss operation". This script is huge so I won't get into details of that here but in general - using that is not an option too.

So... what's the recommended approach? How can I update swift on the existing website that I have? Do you have any script that would just apply incremental schema changes?


Replies

 
Karol Barkowski
Reply

So... there's no easy solution for updating Swift on a working website, right?

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Karol,

 

It's rare that Swift versions introduce breaking changes. There can be added features though

 

Assuming you are experiencing them, it depends on a few things:

  • Have you made any customizations?
    • If not, then restarting the app pool (or clicking "Refresh" in Settings > Item Types > "Refresh" mini ribbon bar button) wil update all Items.
    • The templates should honor any changes
    • You may have to review the Item Types and review the new settings
  • If you've made customizations:
    • I'll assume you have some Version Control in place
    • Once you update all templates from the latest Swift version
    • Then you can "cherry-pick" all of your commits which will re-apply your changes and prompt you for conflicts
    • I know this is a simplification of the process, but that's how we do it

 

That said:

  • You can use the Deployment tool to compare a new version with the current one
  • The Deployment tool cannot be triggered from the place where you are in the UI
  • You can unzip the attached DataGroups that will basically mimic the UI (making it easier to navigate if that's how your mind works) and help compare the changes
    (this is for DW9)
  • It will not be easy to compare Pages, Rows and Paragraphs though, since it's a flat list, not a tree view - but gets you somewhere

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum