Support

Admin Tools

#21740 Change database prefix in Mariadb

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

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

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by user86335 on Monday, 22 December 2014 10:03 CST

user86335
 With the Admin Tools extension, I was mainly looking to use it to change my Joomla Database Table Prefix. Although I read the text in bold red on your documentation that says "This feature is only available on sites using the MySQL database server" I presumed it might also work on MariaDB since MariDB is a drop-in replacement of MySql. Also from the SSH point of view, it is still referred to as Mysql server. But when I went to the Admin Tools in Joomla Backend, I dont see the Link to Changing your database table prefix anywhere. So that made me realize that perhaps it wont work on MariaDB at all although its very similar to MySql. Is that right?

Is there any way I can change my Database Table Prefix I had stupidly chose during the installation?

If it is supposed to be work on Mariadb as well, then can be point out what I am missing?

Thank you for your help.

Cheers,
Neel.

nicholas
Akeeba Staff
Manager
Please remember that this feature depends on the database driver you are using on your site, NOT the actual database server. Moreover, this feature will only enable itself when the reported database server major version (as reported by the database driver) is 5. Since MariaDB reports that it is MySQL version 10 point something we cannot provide support for it.

FYI, the prefix change option will be removed in a future version of Admin Tools. It was included back in the Joomla! 1.5 era when it made sense: Joomla! would always install itself with the predictable jos_ prefix unless you asked it to change it. Nobody did, so everyone had to change the prefix afterwards. Since Joomla! 1.7 the Joomla! installation is creating a random prefix every time it runs. You no longer need to change the prefix afterwards. We only left this feature in Admin Tools because of all the Joomla! 1.6 sites which were upgraded to Joomla! 2.5. Now that Joomla! 2.5 is EOL and we're about to drop support for it there's no reason to keep this legacy feature.

FYI, if you're in a pinch and want to change your database prefix fast you can do so with Akeeba Backup: take a backup of your site and restore it on top of the site itself. In the second step you can see your database connection information. The topmost field in the right-hand column is your prefix. Change it and complete the restoration. Then you can manually remove the tables with the old prefix from your database. This method is actually much better than the one used by Admin Tools: it's unlikely to time out and takes care of foreign keys and specially named database table fields in Community Builder.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user86335
Thank you Nick for writing to me. I appreciate that.

You are right, when installing Joomla 3 it did give a random table prefix but me like a genius changed it to joom_ (dont ask me why). Now when I was reviewing the Joomla security checklists on other sites I came to realize what a dumb thing that was to do. Thats why I was trying to change the table prefix again to something random. Anyhow, what I did now was I exported the sql dump, opened it in dreamweaver, used find & replace to replace the old prefix to new prefix, I then imported it into joomla database, changed global configuration setting to new prefix and then deleted the old prefixed tables. It seems to work now from what I can see. I am hoping this is enough and it doesnt break things. Do you think what I did is enough? If not I was thinking if I should just uninstall joomla and reinstall it all over again just to make sure everything works fine since I just started.

nicholas
Akeeba Staff
Manager
What you did is pretty close to what Admin Tools would've done (blindly rename tables), so I guess it's a "good enough" solution for most sites. Apparently a good enough solution for your site too.

The bottom line of this story is to never change the random prefix proposed by Joomla!. There's a reason those of us dealing with site security pushed hard for four long years to get this darn thing randomized by default ;)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user86335
You are right. A lesson learnt :)

Thank you Nick.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!