How to change tables prefix in a test site copy?

RobertG

Member
Hi,

I want to test a Joomla! 5 migration and I cloned the J4 site with a new prefix for the tables (bgma5_ instead of hr5i3_).
So I get an error with Fabrik and I wonder how to change this prefix for all Fabrik connections. Do I need to make changes to the bgma5_fabrik_lists table (and perhaps others) or is there an easier way in administration?
Thanks for your advice!
 
In your cloned site Joomla admin, go to Components - Fabrik - Connections and you should be able to change the database there. Fabrik might even detect this and change it for you. You might need the password for the new database. Test your connection and it should be ok.
 
Thanks,
The connection was already changed to the new database when I cloned with Akeeba, but I changed the tables prefix in the table restoration and Fabrik don't change it in the fabrik_lists table, so the lists can't work because of the old prefix
 
So, your database on the J4 site was sql8117_49.hr5i3 and the database on the cloned site is sql8117_49.bgma5? In which case, you should be able to change the database connection in the cloned site as above? Or am I missing something? I've cloned sites before but not with Akeeba Backup.
 
In the connection options of Fabrik, there is no way to change the prefix, the old prefix remains in the fabrik_lists table and perhaps on other tables.
The change of the prefix for the "core" tables of Fabrik works after the restoration, the stored data are not updated with the new prefix.

I think the only way is to export Fabrik data, change the prefix in them and import the new data to update the table. Or make changes on each row in the table with phpMyAdmin.
 
So you have Fabrik lists linked to (data) tables named with the J! database prefix?
And/or custom code using the DB prefix literally (not #__some-table)?
In this case you should not change the prefix in your copied J! site, just use the original one.

Fabrik takes care of the prefix in case of the user element.
But other table names are stored as they are, Fabrik can't know if you want to link to a table with J! prefix or of you want to link exactly to this tablename.

You can try something like https://regularlabs.com/dbreplacer
 
Thanks troester!
It's a shame that you can't change table names or prefixes in the list management pages, for example.
I'll find a solution ;)
 
Finally, I'm going to delete this copy and restore the backup again without changing the table prefix.
If I understand correctly, it would be better for all the additional tables not to use the site prefix, so that the prefix can be changed without affecting the contents of the Fabrik tables.
 
I understand, troester!
But I'm very patient and I've made a lot of changes to the database on a local copy of the J4 site. All the additional tables have now their own prefix, which allowed me to later change the prefix of the Joomla! tables.
The site was working properly, but I wasn't able to migrate to J5 on the local server (80% and stop :(). I had to put it back on a sub-domain on my remote server, and apparently everything's working now.
I still have a lot of work to do to reach my goal. ;)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top