I installed Umbraco forms, then uninstalled it and remove the forms tables. There used to be Contour on there. The reason I removed the form tables it because on another installation I could only get Forms install working by deleting Coutour tables first.
Anyway, when I just reinstalled FOrms and it did not put the tables back. How can I force the table script to run again when I reinstalled Forms?
For Umbraco 13, if anyone needs to uninstall Umbraco Forms, the following achieved that for me:
-- Delete the Umbraco key if it exists
IF EXISTS (SELECT 1 FROM umbracoKeyValue WHERE [key] = 'Umbraco.Core.Upgrader.State+UmbracoForms')
BEGIN
DELETE FROM umbracoKeyValue WHERE [key] = 'Umbraco.Core.Upgrader.State+UmbracoForms';
PRINT 'Deleted UmbracoKeyValue entry.';
END
ELSE
PRINT 'UmbracoKeyValue entry not found.';
-- Drop Foreign Key Constraints only if they exist
DECLARE @constraint NVARCHAR(255);
DECLARE @table NVARCHAR(255);
DECLARE @sql NVARCHAR(MAX);
DECLARE constraint_cursor CURSOR FOR
SELECT fk.name, t.name
FROM sys.foreign_keys fk
JOIN sys.tables t ON fk.parent_object_id = t.object_id
WHERE fk.name IN (
'FK_UFFolders_UFFolders_Key',
'FK_UFFolders_UFFolders_ParentKey',
'FK_UFForms_UFFolders_FolderKey',
'FK_UFForms_UFFolders_Key',
'FK_UFForms_umbracoNode_id',
'FK_UFRecordAudit_UFRecords_Id',
'FK_UFRecordDataBit_UFRecordFields_Key',
'FK_UFRecordDataDateTime_UFRecordFields_Key',
'FK_UFRecordDataInteger_UFRecordFields_Key',
'FK_UFRecordDataLongString_UFRecordFields_Key',
'FK_UFRecordDataString_UFRecordFields_Key',
'FK_UFRecordFields_UFRecords_Record',
'FK_UFRecordFields_UFRecords_Id',
'FK_UFUserFormSecurity_UFForms_Key',
'FK_UFUserGroupFormSecurity_UFForms_Key',
'FK_UFUserGroupStartFolders_UFFolders_Key',
'FK_UFUserGroupStartFolders_UFFolders_FolderKey',
'FK_UFUserStartFolders_UFFolders_FolderKey',
'FK_UFUserStartFolders_UFFolders_Key'
);
OPEN constraint_cursor;
FETCH NEXT FROM constraint_cursor INTO @constraint, @table;
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = 'ALTER TABLE ' + QUOTENAME(@table) + ' DROP CONSTRAINT ' + QUOTENAME(@constraint);
EXEC sp_executesql @sql;
PRINT 'Dropped constraint: ' + @constraint + ' from table: ' + @table;
FETCH NEXT FROM constraint_cursor INTO @constraint, @table;
END
CLOSE constraint_cursor;
DEALLOCATE constraint_cursor;
-- Drop Tables only if they exist
DECLARE @tablename NVARCHAR(255);
DECLARE table_cursor CURSOR FOR
SELECT name FROM sys.tables
WHERE name IN (
'UFDataSource',
'UFFolders',
'UFForms',
'UFPrevalueSource',
'UFRecordAudit',
'UFRecordDataBit',
'UFRecordDataDateTime',
'UFRecordDataInteger',
'UFRecordDataLongString',
'UFRecordDataString',
'UFRecordFields',
'UFRecords',
'UFRecordWorkflowAudit',
'UFUserFormSecurity',
'UFUserGroupFormSecurity',
'UFUserGroupSecurity',
'UFUserGroupStartFolders',
'UFUserSecurity',
'UFUserStartFolders',
'UFWorkflows'
);
OPEN table_cursor;
FETCH NEXT FROM table_cursor INTO @tablename;
WHILE @@FETCH_STATUS = 0
BEGIN
SET @sql = 'DROP TABLE ' + QUOTENAME(@tablename);
EXEC sp_executesql @sql;
PRINT 'Dropped table: ' + @tablename;
FETCH NEXT FROM table_cursor INTO @tablename;
END
CLOSE table_cursor;
DEALLOCATE table_cursor;
PRINT 'Umbraco Forms key value, tables and constraints removed successfully.';
How to force forms reinstall including tables
Hi,
I installed Umbraco forms, then uninstalled it and remove the forms tables. There used to be Contour on there. The reason I removed the form tables it because on another installation I could only get Forms install working by deleting Coutour tables first.
Anyway, when I just reinstalled FOrms and it did not put the tables back. How can I force the table script to run again when I reinstalled Forms?
Thanks!
Hi Damon
Did you find a solution?
We just removed all tables manually. It works.
For Umbraco 13, if anyone needs to uninstall Umbraco Forms, the following achieved that for me:
is working on a reply...