Support

Admin Tools

#38958 Restoring Site with Akeeba Backup to another host best practices

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
4.3.1
PHP version
8.0.28
Admin Tools version
7.3.2

Latest post by [email protected] on Monday, 08 May 2023 12:32 CDT

[email protected]

Hello again!

I was hoping to that you could provide some quick guidance regarding site restoration for development and testing.

In my use case, I am backing up a site with Akeeba Backup and Admin Tools installed. I used the backup to restore the site to another virtual host. I have configured Admin tools on the source site, however, when restoring the backup to another virtual host, I get some issues with PHP versions and .htaccess regeneration.

Currently, my process is:

1. Restore site to new host -  in Akeeba Kickstart Pro, I choose "No Change" on configuration files.

2. On new host, I go into Admin Tools and regenerate the .htaccess

3. I then have to go to the Spanel on the virtual host and re-set the PHP version as the previous step removes the PHP version.

4. Changing PHP version in Spanel then forces another regeneration in Admin Tools

 

My questions:

Is there a more streamlined way to do this? I am also concerned that by changing the PHP versions in SPanel it may overwrite any security that Admin Tools provides.

Would it be easier/better to re-run the Quick Setup Wizard and import the configuration settings?

Any tips would be greatly appreciated.

Eric

nicholas
Akeeba Staff
Manager

 I am also concerned that by changing the PHP versions in SPanel it may overwrite any security that Admin Tools provides.

Let's start with putting your mind at ease. Changing your PHP version in cPanel has no impact to your security. cPanel's multi-PHP versions feature is actually fairly simple. First, it looks to see if it's already modified the file (it puts a comment line with a specific structure). If it's already modified it, it replaces its own lines only with the new ones. If not, it appends its own thing at the bottom of the file.

The only thing cPanel adds / modifies is an AddHandler line which tells Apache which predefined FastCGI executable to use to parse .php files. It just wraps it inside an IfModule block because cPanel is designed to be, um, idiot-resistant. Some people who fancy themselves as hosts shouldn't be allowed near a computer, but that's another story and I digress.

Would it be easier/better to re-run the Quick Setup Wizard and import the configuration settings?

No. The Quick Setup Wizard resets everything to factory defaults. You'd have to redo your site's security afresh. Don't punish yourself like that.

I would follow a different process.

  1. Set the new PHP version. This creates a new .htaccess file with the requisite AddHandler lines.
  2. Open the .htaccess file and note down the AddHandler line.
  3. Create a new database and database user. Remember to connect the DB user with the database, allowing all privileges cPanel lets you assign.
  4. Upload Kickstart and the backup archive. Obviously ;)
  5. Use Kickstart to extract the backup archive, then go through the restoration process. During the restoration choose to reset the .htaccess file to the Joomla default. Note that Kickstart and ANGIE are aware of the AddHandler line added in step 1 and carry it over to the new file. Therefore, your site will be running under the correct PHP version (server willing...).
  6. Log into the restored site's administrator, go to .htaccess Maker and paste the line from step 2 into the code to add at the bottom of the file. If you had a different AddHandler line there, replace it.
  7. Regenerate the .htaccess file.

At this point you have the security-enhanced .htaccess file created by Admin Tools, with the AddHandler line to apply the new PHP version on your site.

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!

[email protected]

Nicholas,

Wow...thank you for such a detailed response! This is so helpful and will be added to our checklist.

Thank you again for great support!

Eric

 

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!