Support

Documentation

Using from the CLI

[Note]Note

This is an advanced feature for power users. Most regular users should only use Kickstart as a web application.

Akeeba Kickstart 5.0 and later includes a CLI mode. It lets you run Kickstart as a command line application which can extract a backup archive taken with Akeeba Backup or Akeeba Solo.

In its simplest form you can use it as:

php kickstart.php archive.jpa

where

  • php is the path to the PHP CLI executable. You need PHP 5.3.03 or later to run Kickstart.

  • kickstart.php is the path to Kickstart itself.

  • archive.jpa is the path to the JPA, JPS or ZIP archive you want to extract.

Kickstart will extract the backup archive to the current directory. If you want to extract the backup archive to a different directory you should instead use it as

php kickstart.php archive.jpa /extract/to

where

  • /extract/to is the path where extracted files will be placed.

Please note that the directory where files are being extracted must be writable by the user under which the PHP process will be executing. This is typically the same user you are logged in with. Furthermore, unlike the web interface, Kickstart CLI does NOT support the FTP or Hybrid write mode.

The following options can be added at the the end of the command line, separated from the rest of the command line and each other with a space:

  • --password=yourPassword Informs Kickstart about the JPS encryption password. Required when extracting JPS files, ignored otherwise. yourPassword is the JPS encryption password. Remember that it's case-sensitive. Extracting JPS backup archives requires either the mcrypt or OpenSSL PHP extension to be installed and activated on your server. Please keep in mind that even if your site is using HTTPS this doesn't mean that you have the OpenSSL PHP extension installed. You usually have to ask your host to enable it for you.

  • --silent Do not print out any messages. If an error occurs you'll get exit code 255. If the extraction succeeds you'll get exit code 0.

  • --permissions Restore the permissions stored in the backup archive. Otherwise folders get 0755 permissions and files get 0644 permissions (recommended for most sites).

  • --dry-run Do not write anything to disk. Useful to test the integrity of a backup archive or list its contents. The latter, combined with the --extract flag, can be useful when you want to only extract a few files from the backup. We all had that client (or were that person) who deleted the wrong image on a live server, right?

  • --ignore-errors Ignore most file write and archive errors. Useful to extract semi-corrupt archives which otherwise fail.

  • --delete-before Delete all files and folders already present in the path where extracted files will be placed before extracting the archive. THIS MAY INCLUDE FILES AND FOLDERS WHICH DO NOT BELONG TO YOUR SITE AND WHICH DO NOT EXIST INSIDE YOUR BACKUP ARCHIVE. This is a DANGEROUS option and by enabling it you assume all responsibility and liability.

  • --extract=patterns Only extract files matching these patterns. Equivalent to the "Files to Extract" feature of the web version of Kickstart. Enter the file paths or shell patterns separated by commas.

    Watch out! You may need to enclose the argument to the right hand of the equals sign in single quotes to prevent the shell from expanding the shell patterns before running Kickstart! For example, passing --extract=images/*.png may fail because the shell is trying to expand images/*.png before running Kickstart. Passing --extract='images/*.png' on the other hand will work since you are telling the shell "do not expand shell patterns inside the single quotes". Kindly note that this is dependent on the behavior of your shell (bash, csh, cmd.exe, Powershell, ...) and has NOTHING to do with our software - therefore we can't really help you with that, sorry.

Differences from the Kickstart web interface

Unlike Kickstart's web interface, the CLI mode does NOT rename the .htaccess, php.ini and .user.ini files. If you are extracting on a different server or location (file system directory, web subdirectory, domain or sub-domain) than the one you backed up from it MAY be impossible to access the restoration script (visit the installation directory from the web).

Kickstart CLI merely extracts the backup archive, it does NOT restore the site. This isn't different from Kickstart's web interface (the site restoration is done by the restoration script which is included in the backup archive, not Kickstart) but we feel we have to stress it out. After extraction you still need to access the installation directory to complete the site restoration. Alternatively, if you are a subscriber to any subscription which includes Akeeba Backup or Akeeba Solo, you may use Akeeba UNiTE to automatically extract and restore backup archives.

Kickstart CLI does not support writing to files over FTP or the Hybrid file write mode. This is deliberate and won't change. Both FTP and Hybrid file write modes were created as an attempt to overcome limitations in the way web servers handle PHP scripts. Kickstart CLI running from the command line it has the same privileges as the user you are logged in with, therefore doesn't need to go through the inefficient FTP upload workaround.

Kickstart CLI does not support the Stealth Mode. That requires replacing the extracted .htaccess file and switch it back after the site's restoration. While that makes sense in a web interface, it doesn't make sense in a CLI environment. You can always create your own stealth .htaccess file after extracting the backup archive.

Kickstart CLI does not support the additional Kickstart features like importing from a URL, importing from S3 or downloading Joomla! or WordPress for you. These are all features which only make sense in the web. In a command line environment you can always use wget or curl to import files from a URL (including downloading the latest CMS versions!) and s3cmd to download from Amazon S3. Therefore Kickstart CLI won't try to reinvent the wheel by reproducing partial functionality of well-tested solutions.

All in all, Kickstart CLI is meant to be a part of your command line toolchain which will help you manage your site backups most efficiently.