Run the support utilities

This topic applies to Enterprise Edition only

Contents

Overview of the support utilities

The Magento support utilities (also referred to as the Data Collector) enable Enterprise Edition (EE) users to gather troubleshooting information about your system that can be used by our Support team.

Magento Support uses these backups (also referred to as dumps) to analyze issues that require access to your code. A typical scenario follows:

  1. You’re having an issue with your Magento store and you contact Magento Support.
  2. Support determines they need to see your code or database to reproduce the issue.
  3. You back up the code to a .tar.gz file.

    This backup excludes your media files to speed up the process and to result in a much smaller file.

  4. You back up the database to a .tar.gz file.

    By default, sensitive data is hashed when making the backup.

  5. You upload your backups to a file sharing service.
  6. Support analyzes your issues without affecting your development or production environment.

The utilities can take several minutes to complete.

First steps

  1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.

    If you use the bash shell, you can also use the following syntax to switch to the Magento file system owner and enter the command at the same time:

    su <Magento file system owner> -s /bin/bash -c <command>
    

    If the Magento file system owner does not allow logins you can do the following:

    sudo -u <Magento file system owner>  <command>
    
  2. To run Magento commands from any directory, add <your Magento install dir>/bin to your system PATH.

    Because shells have differing syntax, consult a reference like unix.stackexchange.com.

    bash shell example for CentOS:

    export PATH=$PATH:/var/www/html/magento2/bin
    

You can also run the commands in the following ways:

  • cd <your Magento install dir>/bin and run them as ./magento <command name>
  • php <your Magento install dir>/bin/magento <command name>

<your Magento install dir> is a subdirectory of your web server's docroot. Need help locating the docroot? Click here.

In addition to the command arguments discussed here, see Common arguments.

Create a code backup

This command backs up code and compresses it in tar.gz format.

This is not the same code backup performed by the magento setup:backup command. This command is intended to be used to back up code for examination by Magento Support.

Command options:

magento support:backup:code [--name=<file name>] [-o|--output=<path>] [-l|--logs]

where

  • --name specifies the dump file name (optional). If you omit this parameter, the dump file is time and date-stamped.
  • -o|--output=<path> is the absolute file system path to store the backup (required).
  • -l|--logs includes log files (optional).

For example, to create a code backup named /var/www/html/magento2/var/log/mycodebackup.tar.gz, enter:

magento support:backup:code --name mycodebackup -o /var/www/html/magento2/var/log

After the command completes, provide the code backup to Magento Support.

Create a database backup

This command backs up the Magento database and compresses it in tar.gz format.

This is not the same code backup performed by the magento setup:backup command. This command is intended to be used to back up code for examination by Magento Support.

Command options:

magento support:backup:db [--name=<name>] [-o|--output=<path>] [-l|--logs] [-i|--ignore-sanitize]

where

  • --name specifies the dump file name (optional). If you omit this parameter, the dump file is time and date-stamped.
  • -o|--output=<path> is the absolute file system path to store the backup (required).
  • -l|--logs includes log files (optional).
  • -i|--ignore-sanitize means that data is preserved; omit the flag to hash sensitive data stored in the database when creating the backup (optional).

After the command completes, provide the database backup to Magento Support.

What is sensitive data?

Magento uses your encryption key to encrypt the following:

  • Credit card information
  • User names and passwords specified in the Magento Admin configuration (for example, logins to payment gateways)
  • CAPTCHA values sent over the network

Magento does not encrypt:

  • Administrative and customer user names and passwords (these passwords are hashed)
  • Address
  • Phone number
  • Other types of personally identifiable information except for credit card numbers

Troubleshooting: display utilities and paths

We provide commands that display paths to utilities required by the Data Collector and the command line. You can use these commands, for example, if errors like the following display in the Admin or on the command line:

Utility lsof not found

Run the following commands in the order shown to display the paths to the applications used by the support utilities and Data Collector:

  1. Change to your Magento installation directory.

    For example, cd /var/www/magento2

    The commands run properly only from your Magento installation directory.

  2. php bin/magento support:utility:paths creates <your Magento install dir>/var/support/Paths.php, which lists the paths to all application used by the utility.
  3. php bin/magento support:utility:check displays the file system paths.

A sample follows:

gzip => /bin/gzip
lsof => /usr/sbin/lsof
mysqldump => /usr/bin/mysqldump
nice => /bin/nice
php => /usr/bin/php
tar => /bin/tar
sed => /bin/sed
bash => /bin/bash
mysql => /usr/bin/mysql

To resolve issues with running the tools, make sure these applications are installed and are in the web server user’s $PATH environment variable.