Title: Import media files with VIP-CLI
Author: WordPress VIP Documentation
Published: December 12, 2025
Last modified: April 22, 2026

---

 1. [VIP File System](https://docs.wpvip.com/vip-file-system/)
 2. [Import media files](https://docs.wpvip.com/vip-file-system/import-media-files/)
 3. Import media files with VIP-CLI

#  Import media files with VIP-CLI

Media files that are contained within a file archive (`.zip`, `.tar.gz`, or `.tgz`)
can be imported to the VIP File System for a production environment with the VIP-
CLI command: `[vip import media [options] [command]](https://docs.wpvip.com/vip-cli/commands/import/media/)`.
The file archive can be located at a publicly accessible remote URL or on a user’s
local machine.

**Prerequisites**

 * [VIP-CLI is installed](https://docs.wpvip.com/vip-cli/installing-vip-cli/) and
   has been updated to [the most current version](https://www.npmjs.com/package/@automattic/vip/v/latest).
 * A user must have at minimum either an  [Org member role](https://docs.wpvip.com/manage-user-access/vip-dashboard/app-role/)
   or an [App write role](https://docs.wpvip.com/manage-user-access/vip-dashboard/org-roles/)
   for that application.
 * Review all [limitations and requirements](https://docs.wpvip.com/vip-file-system/import-media-files/limitations-and-requirements/)
   that apply to importing media files with VIP-CLI.

#### VIP-CLI command examples

For demonstration purposes, the `<app-name>` value `example-app` and the `<env>`
value `production` are used in the VIP-CLI command examples below. Read more about
[how to target environments in VIP-CLI commands](https://docs.wpvip.com/vip-cli/target-environments/).

 * Local path
 * Remote URL

Example command for importing a file archive from the user’s local machine located
at file path `/path/to/uploads.tgz`:

    ```lang-shell
    vip @example-app.production import media /path/to/uploads.tgz
    ```

Example command for importing a file archive from the publicly accessible URL `https://
www.example.com/uploads.tar.gz`:

    ```lang-shell
    vip @example-app.production import media "https://www.example.com/uploads.tar.gz"
    ```

**Note**

File-sharing services such as [Dropbox](https://help.dropbox.com/files-folders/share/force-download),
[Box](https://support.box.com/hc/en-us/articles/360043697094-Creating-Shared-Links),
or WeTransfer can be used to host a file archive at a publicly accessible remote
URL (e.g. `https://www.example.com/uploads.tar.gz`).

If using a [downloadable](https://help.dropbox.com/files-folders/share/force-download)
Dropbox URL, it must include a `?dl=1` query parameter.

Google Drive URLs are not supported.

During the import process, the CLI will display the real-time progress of the import.
The real-time progress of an import can be hidden by pressing the `Ctrl + C` key
combination.

When all files in the archive have been processed, a status report for the import
will be created within the current working directory. The exact path to the status
report will be output in the terminal.

**Caution**

**SVG files allow embedded JavaScript, which can pose a security risk**. If an SVG
file exists in an `uploads/` directory for import, the contents of the SVG file 
should be scanned prior to import.

Examine the contents of an SVG file with:

 * A local [PHPCS scan](https://docs.wpvip.com/php_codesniffer/) using the `WordPress-
   VIP-Go` standard
 * A file editor (e.g. [Visual Studio Code](https://code.visualstudio.com/))
 * Or a tool such as [the SVG Sanitizer Test](https://svg.enshrined.co.uk/) or [VIP’s SVG Sanitizer](https://github.com/Automattic/vip-go-svg-sanitizer)

## Check the status of a media import

VIP-CLI command: `[vip import media status [options]](https://docs.wpvip.com/vip-cli/commands/import/media/status/)`

Check the status of a currently running media file import or retrieve an error log
of the most recent media import.

 * **If an import is currently running**, the output will be for the currently running
   import, and the `status` command will continually check and report back on the
   status of the import process until it is in a finished state (`COMPLETED`, `ABORTED`,
   or `FAILED`).
 * **If an import is _not_ currently running**, the output will be for the import
   that ran most recently.

Example output of the `vip import media status` command:

    ```lang-shell
    vip @example-app.production import media status
    =============================================================
    Checking the Media import status for your environment...
    Imported Files: 95/100 - 95% ✓
    =============================================================
    Status: COMPLETED ✓ : The imported files should be visible on your App
    App: mytestsite (PRODUCTION)
    =============================================================

    ⚠️  5 file error(s) have been extracted

    All errors have been exported to /Users/myuser/media-import-mytestsite-1642371503508.txt
    ```

The `Imported Files:` field in the output provides the number and percentage of 
files that were successfully imported.

An included warning (⚠️) message in the output will report if any files failed to
import. The associated errors will be exported to an error log for review.

The `Status:` field will display the overall import status with the following possible
states:

| **Import** **status**  | **Description** | 
| `INITIALIZING` | Contents of the archive file in the URL are downloading. | 
| `RUNNING` | Files are being imported to the File System. | 
| `COMPLETING` | The import is finishing up. | 
| `COMPLETED` | The import is completed.  | 
| `ABORTING` | The import is responding to a `[vip import media abort](https://docs.wpvip.com/vip-cli/commands/import/media/abort/)` request. | 
| `ABORTED` | The import is aborted.  | 
| `FAILED`** | The import failed.  |

**The import can be in a `FAILED` status for a variety of reasons. Review `status`
output, [error logs](https://docs.wpvip.com/vip-file-system/import-media-files/with-vip-cli?output_format=md#format-error-logs),
[limitations](https://docs.wpvip.com/vip-file-system/import-media-files/#limitations),
and the [import checklist](https://docs.wpvip.com/vip-file-system/import-media-files/#h-prior-to-running-any-import-commands-confirm-all-items-in-this-checklist)
before attempting another media import.

## Abort an import

VIP-CLI command: `[vip import media abort [options]](https://docs.wpvip.com/vip-cli/commands/import/media/abort/)`

Abort an import process in progress. All files that were imported prior to executing
the `abort` command cannot be deleted with a VIP-CLI command. Imported files that
have attachment data in a site’s database can be deleted through the WordPress Media
Library.

    ```lang-shell
    vip @example-app.production import media abort
    ```

## Format error logs in JSON

 `--exportFileErrorsToJson`

_Values not accepted._

When running the `vip import media` VIP-CLI command, if one or more files fail to
import, an error log will be generated and can be retrieved at the end of an import.
Error logs include a list of failed files and the reasons for their failure.

By default, import error logs are created in `.txt` format. Add the `--exportFileErrorsToJson`
option (or `-E`) to write the error logs to a `.json` file instead.

    ```lang-shell
    vip @example-app.production import media "https://www.example.com/uploads.tar.gz" -exportFileErrorsToJson
    ```

## Import intermediate images

`--importIntermediateImages`

_Values not accepted._

Traditional installations of WordPress create [intermediate images](https://docs.wpvip.com/vip-file-system/image-files/intermediate-images/);
an array of smaller versions of each uploaded image. The generated intermediate 
files are unnecessary on VIP, as the VIP File System is able to [dynamically generate and cache any requested dimension](https://docs.wpvip.com/vip-file-system/image-files/transformations/)
of the originally uploaded image. This reduces the amount of storage a site requires
and provides image size flexibility at no loss of speed.

If needed, intermediate images can be imported by including the `--importIntermediateImages`
option (or `-i`) when running the `vip import media` command. When including intermediate
images for an import, the process will take a longer time to complete.

    ```lang-shell
    vip @example-app.production import media /path/to/uploads.tar -importIntermediateImages
    ```

**Note**

**For site migrations to the VIP Platform**, importing a site’s intermediate files
might be necessary to [prevent broken links (`404`s) where links to specific intermediate files exist](https://docs.wpvip.com/vip-file-system/image-files/responsive-images/#h-troubleshooting)
in the site’s imported database content. After the migration process, links to an
image’s intermediate size array will be generated on the fly by the VIP File System.

After a site has migrated to VIP, when an image is uploaded through WordPress the
VIP File System will generate URLs on the fly for the intermediate size array.

## Overwrite existing files

`--overwriteExistingFiles`

_Values not accepted._

By default, media imports do not overwrite existing files that share the same name
and file path. Include the `--overwriteExistingFiles` option (or `-o` ) when importing
media files to override this behavior and force the silent [overwriting of an existing file](https://docs.wpvip.com/vip-file-system/versioning-files/#Overwriting-with-VIP-CLI)
that has an identical file name and path.

    ```lang-shell
    vip @example-app.production import media "https://www.example.com/uploads.zip" --overwriteExistingFiles
    ```

An error log file can also be downloaded within 15 minutes of the completion of 
the import process from a URL provided in message output in the terminal. The file
can be accessed from a new URL by running the `vip import media status` command.
The file will remain available for up to 7 days after the import or until a new 
media import is performed.

Last updated: April 22, 2026