Error with migrated v5.6 site

Hi

We have a v5.6 site that we migrated from another provider to our hosting. The site loads fine in a browser, but if you edit a content block you get the following error when you try to save:

An unexpected error occurred. mysqlt error: [1062: Duplicate entry ‘0’ for key ‘PRIMARY’] in EXECUTE(“insert into Blocks (bName, bDateAdded, bDateModified, bFilename, btID, uID) values (NULL, ‘2022-06-14 15:02:47’, ‘2022-06-14 15:02:47’, NULL, ‘9’, ‘1’)”) < Back to Home

What can I try to do to fix this please?

Dave

First thing I would check is that the PRIMARY key for the Blocks table is ‘bID’ and that it is set to ‘AUTO-INCREMENT’

1 Like

Thank you very much for your help, Auto Increment needed setting in Blocks and Block Relations on bID and brID.

I can now save the content block, but when I publish the page I get this:
( ! ) Fatal error: Call to a member function addWorkflowProgressHistoryObject() on boolean in /home/pensioneertruste/public_html/concrete/core/models/workflow/progress/model.php on line 94

I would delete any workflows you have setup in the dashboard and truncate the WorkflowProgressHistory table in the database.

Thanks, unfortunately it hasn’t made any difference. I attach the full error message

Unfortunately it is difficult to offer any further solutions without having the files and database in a test environment.

No problem, thanks for your help.

With multiple errors in on the new server, there could have been something wrong with the copy. Perhaps it was not complete and some tables or the stuff you usually see at the end of a long SQL dump is missing.

If it is still available, go back to the other provider and the original site make a new copy.

Before making the copy: Clear all workflows. Disable and clear all caches. Empty the trash. Empty tmp and incoming files. Remove all old page versions. Disable pretty URLs. In essence, get rid of anything that complicates the cloning process.

Thanks but unfortunately, it is not on the old server anymore

An incomplete database export is often caused by database bloat and the usual culprit for that is the ‘PageStatistics’ table.
It would appear your database is almost complete so it should be possible to repair it.
It is a shame that the old server does not have a copy otherwise you could have truncated the PageStatistics table prior to performing the database export.

1 Like

Thanks. I can’t login to the old site, but I may have access to the DB, I will try that

Thank you very much, truncating that PageStatistics table was the answer, it was much larger than I had realised and brought the size right down. The site is now working correctly.

2 Likes

Glad to have helped!

2 Likes