Umbraco forms - silent error during upgrade migrat...
# help-with-umbraco
w
I have a site running Umbraco v13 which I have upgraded from v8 via v10. I am now trying to install the latest version of Umbraco Forms - I have installed the package via Nuget and can load the Forms section in the backend, however doing so shows this error: Invalid column name 'DeleteEntries'. On checking the Installed Packages view I can see there are Pending migrations for the Umbraco Forms package, selecting the option to Run them shows a "successfully completed" message in the front-end but the console the site was run from shows the following errors: [10:35:00 INF] Create Foreign Key: ALTER TABLE [UFUserGroupFormSecurity] ADD CONSTRAINT [FK_UFUserGroupFormSecurity_UFForms_Key] FOREIGN KEY ([Form]) REFERENCES [UFForms] ([Key]) [10:35:00 ERR] Exception (9b7b8baf). Microsoft.Data.SqlClient.SqlException (0x80131904): There are no primary or candidate keys in the referenced table 'UFForms' that match the referencing column list in the foreign key 'FK_UFUserGroupFormSecurity_UFForms_Key'. Could not create constraint or index. See previous errors. Plan failed at step 7c7bc5ee-4c5b-42dc-9576-5ce6dfbddb8e Has anybody encountered this error or similar before, or has any advice on resolving it?
Failing that - does anybody know if it's possible to run all the package migrations for a given version, including those which came before? Wondering if something has been missed out in terms of a prior change
o
Yip, I've ran in to this doing a similar upgrade. I manually added the Delete Entries table in to the database.
I actually had a look at the migrations via dotPeek to run them manually.
The issue I had was for View and Edit Entries folders - Migration from V8-11 I think ideally you need to upgrade Forms in U8 to the latest version, then upgrade forms again when you upgrade umbraco to U10.
There are a few steps that don't seem to jump from 8 -> 13
w
Ideal, thanks very much @Owain - I've been trying to find the migration code myself. Will see if I can re-run some upgrade steps against another database copy..
o
I think it's somewhere around Umbraco Forms 8.11 that has the new tables added.
If you check your database table for dbo.UFUserSecurity, you'll probably be missing EditEntries, DeleteEntries and ViewEntries in the table
p
I've hit this and wondered if there is a reliable way to ensure the database matches the required schema because the shipped migration does not seem to do that because even after running it again the missing fields are not present. I've just has some success by tacking this on the end of my custom migration plan...
Copy code
From("MYSTATE").To<AddDeleteEntriesPermissions>("FormsAddDeleteEntriesPermissions");
From("FormsAddDeleteEntriesPermissions").To<AddCreatedAndUpdatedByToEntities>("FormsAddCreatedAndUpdatedByToEntities");
From("FormsAddCreatedAndUpdatedByToEntities").To<AddRecordAdditionalDataColumn>("AddRecordAdditionalDataColumn");
I am hoping to do something similar if I come across any other missing fields but it still does not ensure a correct schema at the end.
w
Good luck @ProNotion - for what it's worth we ended up just starting from scratch with Forms, as tracking down every migration was taking too much time
p
@weedroid I think you might be right. I have a lot of forms to get in there - how did you handle that?
w
It was all manual I'm afraid, just recreating the forms and their fields via the back office
p
OK, that's not an option for me, it would be a painful experience as we have over 70 forms some of which are multi-step 😞
I think on my last migration I exported the schema from a fresh install and compared it with an export of my migrated database and then used AI to come up with a script to bring them in line. I should have documented it at the time but may look at that appraoch again.
w
Sounds like a good plan, I hope it gets you further!
s
https://jumoo.co.uk/usync/forms/ might be very helpful here
p
Thanks, I have a feeling I am using that but from memory it is only supported in v8+ and my migration bypasses v8 completely so I couldn't use it until later on in my migration.
208 Views