Backup installation from CLI

Backup an installation from Command Line


Softaculous allows you to backup an installation from command line.

For System Admin

  • Use the following command to backup an installation while running as root on CLI :
php /path/to/softaculous/cli.php --backup --user=USER --insid=INSID --backup_location=BACKUP_LOCATION
  • Thats it. The installation is now backed up.

Parameters

  • In the above command the first parameter should be –backup as this parameter will initiate the backup function.
  • –user=USER – Here USER is the user under which the installation is made.
  • –insid=INSID – Here insid is the installation id of the installation you want to backup.
  • –backup_location=BACKUP_LOCATION – Here backup_location is the location id of the backup location where you want to store your backup. You can find the location id of the backup location from the URL of Edit Backup Location page. Default will be the backup location selected in the installation settings.

Optional Parameters

Note : These parameters are optional and if none of these parameters are passed the full installation i.e. directory as well as database will be backed up.

  • –dir=1 – Use this parameter if you want to backup the directory.
  • –db=1 – Use this parameter if you want to backup the database.
  • –datadir=1 – Use this parameter if you want to backup the data directory (some scripts have data directory).
  • –wwwdir=1 – Use this parameter if you want to backup the web directory (PERL scripts have web directory).

So if you pass only –db=1 parameter, then only the database of your installation will be backed up. Similarly if you pass only –dir=1 parameter only the directory of your installation will be backed up.

For User

  • Use the following command to backup an installation while running as a user on CLI :
php /path/to/softaculous/cli.php --backup --insid=INSID --backup_location=BACKUP_LOCATION
  • Thats it. The installation is now backed up.

Parameters

  • In the above command the first parameter should be –backup as this parameter will initiate the backup function.
  • –insid=INSID – Here insid is the installation id of the installation you want to backup.
  • –backup_location=BACKUP_LOCATION – Here backup_location is the location id of the backup location where you want to store your backup. You can find the location id of the backup location from the URL of Edit Backup Location page. Default will be the backup location selected in the installation settings.

Optional Parameters

Note : These parameters are optional and if none of these parameters are passed the full installation i.e. directory as well as database will be backed up.

  • –dir=1 – Use this parameter if you want to backup the directory.
  • –db=1 – Use this parameter if you want to backup the database.
  • –datadir=1 – Use this parameter if you want to backup the data directory (some scripts have data directory).
  • –wwwdir=1 – Use this parameter if you want to backup the web directory (PERL scripts have web directory).

So if you pass only –db=1 parameter, then only the database of your installation will be backed up. Similarly if you pass only –dir=1 parameter only the directory of your installation will be backed up.

Was this helpful to you?