#241 Database tables migration from J3 to J4

Posted in ‘Migration Requests’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by ulric gress on Sunday, 11 May 2025 12:32 UTC

ulric gress

Hi J2Commerce team,

It’s a great pleasure to see that J2Store continues to thrive as J2Commerce.
Coming from Joomla 3, I’ve followed your excellent tutorial to successfully migrate to Joomla 4 with the latest version of J2Store 4 Pro. Everything went smoothly, including the DIBS Easy payment plugin – with Danish language support as well. Fantastic!

During this major migration process, I’ve been working locally on MAMP to rebuild the site – updating the template to (T4 Framework) Meanwhile, the live Joomla 3 site is still running, functioning just fine and still taking orders.

Once I'm done finalizing the design and adjustments on the new Joomla 4 site with the T4 Framework, I’ll need to move everything live. At that point, I’m wondering: what is the best way to transfer the updated order and invoice data from the live Joomla 3 site to the new Joomla 4 installation? Especially considering AUTO_INCREMENT values and other order-related MySQL data.

Do you have a recommendation for this kind of setup? Or is there a better workflow you’d suggest for going live after such a major update?

Thanks again for your fantastic work!

Kind regards,
Ulric Gress

Adam Melcher

Ulric,

Apologies for the delay, I realized after browsing down the tickets that yours slipped right through. (I know why - it's not a fast answer so I meant to circle back around and it slipped through).  If this ticket is still open for you and you need the answer, I can reply back with the exact database tables that I copy over from the live site to the staged site and how to do it so you don't lose database updates on those tables in the process.

 

Let me know,

 

Adam

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Thanks Adam,
No worries at all – there's no stress or rush with this project, I’m just really happy that J2S is alive again 😊 I’d really like to know which tables I should synchronize from the live J3 site to the test J5 site right before we go live with the new and fantastic J2Store 4Pro.

It would also be useful to know where I can adjust the AUTO_INCREMENT value if I want the invoice numbering to start from, for example, invoice no. 100 – and whether this should be done directly in the database or through the J2Store settings.

I have a small issue with the DIBS Easy plugin, but I’ll create a separate ticket for that.

Best regards,
Ulric

Adam Melcher

Ulric,

 

Assuming there have been no new coupons or products created on the live site compared to the new J5 site, here are the database tables I usually copy over when transitioning from an active J2 site to the new one:
#__j2store_addresses
#__j2store_cartitems
#__j2store_carts
#__j2store_orderdiscounts
#__j2store_orderdownloads
#__j2store_orderfees
#__j2store_orderhistories
#__j2store_orderinfos
#__j2store_orderitemattributes
#__j2store_orderitems
#__j2store_orders
#__j2store_ordershippings
#__j2store_orderstatuses
#__j2store_ordertaxes
#__user_usergroup_map
#__users

To ensure that there are no database issues, what I do is export these tables as data only (not with structure) which would allow you to keep the Joomla 5 table's updated structure. What I do for each table:
Export the table (data only) (J3 site)
Create copy of the table (J5 site)
Empty the table so you only have the field titles with no data (not the copied table) (J5 Site)
Import the data only to the now empty table. 

Repeat this for each of the tables above.

If you find there are no difference in the number of items in the J3 and J5 tables then there is no reason to do the steps above (spot check to make sure the last item is the same for both)

If you are unable to import the data from the J3 site into the equivalent table, it's most likely due to a mismatch in the number of fields in both tables. (usually due to an older j2 plugin that could have added an additional field.  If this is the case and you want to keep the data on the new site, then install that plugin on the j5 site otherwise you would need to either add the extra field to that database or remove it from the live site. Importing them this way ensures you have no strange database issues on the new site.

I usually schedule a time later at night when the client and customers are usually not as active as you would need to put the J3 site in maintenance mode so you don't have new orders coming in after you have already exported them from the J3 site. You can test on the two user tables before hand to get comfortable, and once you put it in maintenance mode, it shouldn't take more than 1 hour to finish everything on the database side and swap the two sites out on the live site...

Let us know if you have any issues,

Adam

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Hi Adam 😊
Thanks a lot for the guide – I’ll experiment with it and get back to you later.
Ulric

ulric gress

Hi Adam

The data migration between J3 and J4/J5 is working perfectly. You really do learn something new about MySQL every day – that's truly where the magic happens.

I’ve now upgraded two J3/J2 stores following your guide.
However, I'm encountering two different errors on each site:

Site 1: When accessing or creating a new "email template", I get the error:
(An error has occurred. Error 0 / 3 arguments are required, 2 given)

Site 2: When trying to export customers via CSV, I get the error:
(An error occurred. Error 0 / Call to undefined method Joomla\CMS\Document\RawDocument::getToolbar())

Do you have any idea what might be causing these errors?
Have I missed something during the upgrade process?

Otherwise, everything seems to be working great — I still need to test the DIBS Easy plugin, but it also looks very promising. :)

Best regards Ulric

ulric gress

Hello J2Commerce / Adam
When can I expect to hear back from you regarding my most recent inquiry?
Best regards Ulric

Olivier

Hello Ulric,

apologies for the delay.

Can you create a ticket for Site 1, adding credentials as we cannot reproduce your issue on our test sites.

For Site 2, we can reproduce the error, therefore this is something we have to fix on our end.

Thank you!

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

ulric gress

Thank You Olivier 👍

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.