Support

Admin Tools

#38088 Two Instances of Joomla Question

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
Joomla 3.10.11 and Joomla 4.2.
PHP version
7.4.33
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 29 November 2022 03:44 CST

enclavecoa

This is a question regarding Akeeba Backup Core 8.2.2 and/or Kickstart 7.1.2.

My site on my ISP is running two instances of Joomla. My primary site is running Joomla 3.10.11 (public_html) and is running Joomla 4.2.5 from a sub-directory (public_html/mm4/). Both are using PHP 7.4.33. I created the Joomla 4.2.5 version using MigrateMe4 from PHP Web Designs.

I recently took a backup using Akeeba Backup Core 8.2.2 of my primary site (which included the mm4/ folder therefore my second instance was also backed up). Then I used Kickstart 7.1.2 to restore the backup to XAMPP (localhost) on my PC. Everything seems to have been restored correctly and I was able to visit both my backend and frontend of the Joomla 3.10.11 instance. However, when I tried to go to the Joomla 4.2.5 backend, I received a Connection error (see attached). This may be an issue with Kickstart. I seem to remember that, during the Kickstart restore process, I was asked for my dB prefix. The Joomla 3.10.11 prefix is "jos_" while the Joomla 4.2.5 prefix is "mm4_jos_". This naming convention was done by the MigrateMe4 process by adding the "mm4_ " prefix to my existing "jos"_ prefix. resulting in a new prefix for the Joomla 4.2.5 of "mm4_jos_". I'm thinking that Kickstart named all of the dB rows as "jos_".

My question is: Can I get to both Joomla instance somehow on XAMPP. If not, I will have to reinstall all of the software on the Joomla 4.2.5 instance on XAMPP which I'd rather not have to do.

nicholas
Akeeba Staff
Manager

What happens is perfectly normal. The restoration only reconfigures one site, the main site which is being backed up.

You should exclude the mm4 folder from your backup of your Joomla 3 site.

On your Joomla 4 site you should install Akeeba Backup 9 and back it up separately.

If both sites are sharing a database, remember to exclude each other's database tables in the Database Table Exclusions page.

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!

enclavecoa

Nicholas:

I have an ancillary question.  Both instances use the same dB.  The J3 instance uses a jos_ prefix while the J4 instance uses a mm4_jos_ prefix in the same dB. Is there any way that I could do as you say above and restore both backups to the same file structure and same dB?  I'd lie the restore the public_html  portion beneath a file system like E:/xampp/htdocs/joomla and then the J4 to a file system like E:/xampp/htdocs/joomla/mm4/. And, have the two dBs concatenated.  Or, will I have to test them separately - one at a time.

nicholas
Akeeba Staff
Manager

You can restore the J3 site in the main directory and the J4 site in a subdirectory using the same database in both restorations. The folder structure and the database structure are independent from each other.

I do not generally recommend your intended setup because of three problems you might get tripped over by:

  • .htaccess and .user.ini files are inherited across the filesystem (not necessarily the web site URL!) structure. This means that the site in the subdirectory will inherit the .htaccess of the main site. This will lead to problems if you are using Admin Tools' .htaccess Maker and, in fact, may also break SEF URLs even if you're using Joomla's default .htaccess content (shipped as an inert htaccess.txt file).

    Solution: Restore the sites to different folders which are not one inside the other.

    Also remember that your .htaccess files' RewriteBase needs to change when transferring the site to the domain's root to take it live. Add a note that you need to go to Components, Admin Tools, .htaccess Maker, scroll all the way down, set the site's directory to / and update the HTTP and HTTPS domain names, then click on Save & Create .htaccess — this will take care of this change for you. Better yet, make it a habit to always do that upon every restoration. This might sound like a chore but will save you a LOT of hair pulling down the line. Trust me.

  • Using the same database may lead you to take a backup which includes all database tables, from both installations. This will break one of the two sites when you restore it again in the same database. This is why I told you that you have to exclude each other's tables from the backup.

    Solution: use separate databases.

  • You are using the database table name prefix mm4_jos_. This has two distinct problems:
    a. It's too long. The recommended size is 5–7 characters, including the underscore.
    b. It has an underscore in the middle. The underscore indicates the END of the database table name prefix. Having it in the middle of the prefix will cause all sorts of problems.

    Solution: Use a table name prefix which is shorter and DOES NOT have an underscore in the middle, consisting only of lowercase letters and numbers e.g. mm4j_.

If you do not heed these recommendations you will most definitely have a bad time, most likely weeks to years later. 

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!

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!