Support

Akeeba Backup for Joomla!

#42260 Auto create a shadow backup website, like UNiTE did.

Posted in ‘Akeeba Backup 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
5.3.3
PHP version
8.3.23
Akeeba Backup version
latest

Latest post by NicoFaaij on Wednesday, 10 September 2025 08:40 CDT

NicoFaaij

Dear support,

 

I want to run a nightly cron job that creates an exact copy of my website on another hosting provider's server. It's a backup. When the hosting provider becomes unreachable or fails, I only have to change the Cloudflare A-record.

I think UNiTE was perfect for that, but you no longer support it.

What is the best way to clone remote Joomla website's now?

I see different approaches, like:

A: Use wget/curl to get all files/directories to the remote server and export and import the database with exactly the same names. Shouldn't this not be the fastest and straight forward way?

B: Create remote backup with your remote.phar. Run kickstart cli to extract the backup-archive, but then I stacked on how to command line execute the installation script with Angie password. I read something about 

php ./cli.php execute $ORIGIN/config.json

, but where does the cli.php and $ORIGIN/config.json comes from and what is the content of the config.json, something as it was in UNiTE?

 

Or is there even a better approach for this user-case?

With thankful regards, Nico

 

nicholas
Akeeba Staff
Manager

The restoration script's CLI mode is a drop-in replacement for UNiTE's core feature: unattended site restoration. The other two features in UNiTE (taking/downloading backups, and extracting backup archives) can be handled by Remote CLI and Kickstart. In fact, UNiTE was using these two products under the hood for these features.

I have already documented how you can put it all together: https://www.akeeba.com/documentation/brs/cli.html#cli-replace-unite 

As you can see, it's basically your Option B.

You can change the command line to Remote CLI to download (and afterwards delete) the backup it's taking remotely, as explained in https://www.akeeba.com/documentation/arccli/options.html under "backup" (it's the --download switch, which allows you to combine the options from the backup and download commands, without having to pass the id as it's automatically detected when taking a backup).

As for the configuration file, you can run php ./cli.php config:make to get the default config.yml.php configuration file for the restoration script.

On your target server you'll just need to have Remote CLI, Kickstart, your config.yml.php file, and your shell script in a directory outside the web root. You can run your shell script to have Remote CLI take a backup and download the backup archive into your site's root (deleting the copy on the source site), run Kickstart to extract it, copy the config.yml.php into the installation directory, run php ./cli.php execute, then clean up (delete the backup archive and the installation directory).

If you prefer, you can use Ansible, Chef, or something similar as well. Having separate commands gives you more flexibility in defining the conditions for taking / downloading a backup, and when to execute an unattended restoration.

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!

NicoFaaij

Thanks Nicholas!

So, do I understand you correctly, the cli.php is a script that the remote backup and kickstart restore will put in the installation directory of the restored Joomla website? After kickstart extracted the archive, I need to run in that installation directory that "php ./cli.php config:make" to get the right config.yml.php? A file, as you documented for UNiTE?

And then I only need to run the command below to get the cloned website fully running and standby on the remote Unix server?

php ./installation/cli.php execute config.yml.php

Regards, Nico

 

 

nicholas
Akeeba Staff
Manager

The installation/cli.php is part of the Backup Restoration Script which is included inside the backup archive itself.

Other than that, yes, you are correct.

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!

NicoFaaij

Thank you so much!!! I will try to implement this on my websites. I still have one more question on this case?

So now I will get a mirrored fallback website early in the morning of all my websites. So the next time a hosting/server is screwed up, I can switch to those mirrors in (Cloudflare) seconds until it's fixed on the original environment.

Better would be if I could keep these mirrored standby server in sync every hour, during the day, every day. But don't you agree, this approach will take too much system/network resources. Is there a light way to do synchronization between them with only the database and maybe also changed/added files during the days? No problem to get a database only backup scheduled with an extra Akeeba Backup profile. But is there also a CLI way to restore only that database backup on the standby server. And in additional to that, can I use something like that for only the changed or added files from the last hour, without putting too much load on the production servers? 

Many thanks for your great support, Nico

P.s.: Yes I know, I am a little paranoid while using hosting parties like SiteGround, (A2)hosting.com, but “Just because you’re paranoid doesn’t mean they aren’t out to get you.” - Woody Allen ;-)

 

nicholas
Akeeba Staff
Manager

Better would be if I could keep these mirrored standby server in sync every hour, during the day, every day. But don't you agree, this approach will take too much system/network resources.

Correct. And you have the right idea about how to go about it.

Create a new backup profile of type "Full site, incremental files". Use the Database Tables Exclusion feature to exclude all tables except what changes often throughout the day. Important! If it's articles, categories, or anything else that has a Permissions tab remember to include the #__assets table.

This backup will only back up the files which have changed, and your high churn database tables. You can run it every few hours (I'd say hourly may be an overkill; every 3 to 6 hours is typically fine for most sites) and restore it on top of your existing hot copy.

Use a full site backup whenever you normally take a full site backup e.g. daily, weekly, monthly. On these dates, pull the full backup onto your hot copy server and restore it after removing all existing files. You will also need to do that when you upgrade Joomla itself since Joomla updates may delete files and restoring a backup does NOT remove deleted files which could lead to the hot copy being broken depending on what changes Joomla has made.

P.s.: Yes I know, I am a little paranoid while using hosting parties like SiteGround, (A2)hosting.com, but “Just because you’re paranoid doesn’t mean they aren’t out to get you.” - Woody Allen ;-)

You can never be too paranoid about data preservation. I have first hand experience. In 2013 when surprise capital controls in Cyprus gave me all of 60 hours to figure out how to move my hosting and my operations before losing access due to non-payment my paranoia proved to be just the right amount. My clients hosted on OVH who shared our paranoia level survived the unprecedented data centre fire which brought other people's sites down for months (and in many cases forever). I've had clients whose host's data centre got wiped out in a flash flood, or a wildfire. Not to mention I've seen data centres getting disconnected for all kinds of improbable reasons, ranging from an idiot in a backhoe ignoring the yellow warning net and digging through a fibre optic bundle, and an earthquake breaking the undersea cable of the data centre's upstream's backbone provider. If I have learned anything in these 25+ years I've been dealing with networking is that it WILL break. It's not a matter of if, it's a matter of when.

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!

NicoFaaij

Thank you so much, Nicholas! I'm going to implement it as discussed above, with confidence and even more enthusiasm, especially after reading your last paragraph. Your products and support are truly amazing!!!

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!