Migrating old projects from jcb v3 to jcb v5 via database #1142
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1142
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
I just tried to move my old projects from JCB v3 to JCB v5, I almost succeeded, but I can't compile the component for joomla 5.
In joomla 3 I used akebabackup to export only the tables from the database that belong to JCB, all of them.
I changed the prefix of the tables in the .sql file to match the prefix from the new Joomla 5.
I imported the .sql file into the joomla 5 database via PhpMyAdmin.
The components, fields and the rest appear in JCB v5, but I can't compile the component for joomla 5 because I get this error:
Field 'modules' doesn't have a default value
Then @Llewellyn told me to: check all your columns that they allow null, and not (not null)
I did, nothing changed.
Expected result
Compile component
Actual result
Folder Path Error
The folder path: /var/www/html/libraries/phpspreadsheet/vendor does not exist, and was not added!
An error has occurred.
1364 Field 'modules' doesn't have a default value
`Call Stack
Function Location
1 () - JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:403
2 Joomla\Database\Mysqli\MysqliStatement->execute() - JROOT/libraries/vendor/joomla/database/src/DatabaseDriver.php:651
3 Joomla\Database\DatabaseDriver->execute() - JROOT/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Get.php:2314
4 VDM\Joomla\Componentbuilder\Compiler\Helper\Get->setNewLangStrings() - JROOT/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Get.php:2264
System information (as much as possible)
Additional comments
Migrating old projects from jcb v3 to jcb v5to Migrating old projects from jcb v3 to jcb v5 via databaseI once got the advice to update it first to joomla 4 copying all stuff to it and then the same to joomla 5, a lot of work which does not might go well.
What you could try and I also did it before and went OK for me.
Create a temporary joomla 5.x.x installation, then install JCB for that version. then export your JCB DB tables from joomla 3 using phpmyadmin and import them into the Joomla 5 DB. If overwriting the table does not succeed then drop the JCB table and try to import the one from the joomla 3 install again. Then reopen the joomla 5 administrator site and check in JCB if your project is there.
It's a bit of work, but as long as the export and import capabilities are not working, this could be a solution.
This is what I did.
A lot has changed from jcb 3 to jcb 5, I think I should make a much simpler transition, not to replace all the tables in jcb, to import only the fields, the admin views, only what is strictly necessary.
Yes indeed. I not exactly aware if there are much differences concerning the DB, but indeed just the table which concerns the project should work.
The issue appears to be related to the migration of projects from JCB v3 (Joomla Component Builder) to JCB v5 on a Joomla 5 installation. You encounter an error stating "Field 'modules' doesn't have a default value" when attempting to compile a component.
Problem Analysis
Database Migration Issue: When migrating the database tables from JCB v3 to JCB v5, the SQL import was performed manually. This may have led to discrepancies in the table schema, particularly regarding default values and nullability constraints.
Modules Field Error: The error specifically mentions the 'modules' field, indicating that this field may not be properly set up to handle null values or might be missing a default value.
Missing Folder Path: There is also a folder path error indicating a missing directory for
phpspreadsheet
vendor libraries. While this is a separate issue, it's essential to resolve it to ensure full functionality.Suggested Steps for Resolution
Check and Set Default Values for Columns:
Folder Path Error:
phpspreadsheet
is no longer in the package (we are working on an alternative).Selective Data Migration:
Database Schema Alignment:
Conclusion
We have moved all our components (many) to Joomla 4 and 5 and this all automatically with simple building for that version from within Joomla 3. We have teams doing this everyday (over and over) so if your not having success we will need more details.
It kind of worked by exporting these tables from joomla 3, JCB v3 and importing them into joomla5, JCB v5.
In Joomla5 & JCB v5, after compilation, when I was trying to install the component, I had a problem with a custom field "created" meant to overwrite the default field that appears in the "publishing" tab.
The default value of the field was "NOW", but didn't work even with the empty value, so I removed the custom field "created".
This worked for me.