PHPackages                             xerxes/s3-move - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. xerxes/s3-move

ActiveLibrary[Database &amp; ORM](/categories/database)

xerxes/s3-move
==============

A Laravel package to migrate files from local storage to Amazon S3 with smart duplicate detection

v1.0.0(5mo ago)123MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Nov 27Pushed 5mo agoCompare

[ Source](https://github.com/xerxes-on/s3-move-laravel)[ Packagist](https://packagist.org/packages/xerxes/s3-move)[ Docs](https://github.com/xerxes-on/s3-move-laravel)[ RSS](/packages/xerxes-s3-move/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

S3 Move for Laravel
===================

[](#s3-move-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e83467dd6e0f97d1cc51109e6ee9a1f74d058a7f288a902542d23e9689c5d6b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7865727865732f73332d6d6f76652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xerxes/s3-move)[![Total Downloads](https://camo.githubusercontent.com/53722e6cfa7230fd733068a4551f19889b28df2d1e68d2d3efa6b8384dd60a89/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7865727865732f73332d6d6f76652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xerxes/s3-move)[![License](https://camo.githubusercontent.com/656d8b2ff519ed3ea5cc980a09e81a065229293e0ccb7d22822057975c97a507/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7865727865732f73332d6d6f76652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xerxes/s3-move)

A Laravel package to migrate files from local storage to Amazon S3 or S3-compatible storage with smart duplicate detection.

Features
--------

[](#features)

- Laravel 10, 11, and 12 compatible
- PHP 8.1+ support
- Migrate files from local storage to S3
- **Smart duplicate detection** - automatically skips files that already exist on S3
- Configurable file extensions filter
- Progress bar for migration tracking
- Detailed migration statistics (migrated, skipped, total)
- Event-driven architecture (fires event on completion)
- Optional local file deletion after migration
- Works with S3-compatible storage (DigitalOcean Spaces, MinIO, etc.)

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require xerxes/s3-move
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --tag=s3move-config
```

This will create `config/s3move.php`.

Configuration
-------------

[](#configuration)

Edit `config/s3move.php`:

```
return [
    // Paths to scan for files
    'local_paths' => [
        storage_path('app/public'),
        public_path('img'),
        public_path('images'),
    ],

    // File extensions to migrate
    'extensions' => [
        'jpg', 'jpeg', 'png', 'gif', 'webp', 'svg',
        'pdf', 'mp4', 'mov', 'doc', 'docx', 'zip',
    ],

    // S3 bucket name
    'aws_bucket' => env('AWS_BUCKET'),

    // S3 path prefix
    'aws_bucket_path' => env('AWS_BUCKET_PATH', '/'),
];
```

Ensure your `.env` has S3 credentials:

```
AWS_ACCESS_KEY_ID=your-key-id
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=your-bucket-name
AWS_ENDPOINT=https://your-endpoint.com  # Optional for S3-compatible storage
```

Usage
-----

[](#usage)

### Basic Migration (Skips Duplicates)

[](#basic-migration-skips-duplicates)

By default, the command will **skip files that already exist** on S3:

```
php artisan s3:move
```

You'll be prompted to confirm before the migration starts.

### Force Migration (No Confirmation)

[](#force-migration-no-confirmation)

```
php artisan s3:move --force
```

### Overwrite Existing Files

[](#overwrite-existing-files)

If you want to replace files that already exist on S3:

```
php artisan s3:move --overwrite
```

### Delete Local Files After Migration

[](#delete-local-files-after-migration)

```
php artisan s3:move --delete
```

**Warning:** Use `--delete` with caution. Files will be permanently deleted from local storage.

### Combined Options

[](#combined-options)

```
# Skip duplicates, no confirmation, delete local files after upload
php artisan s3:move --force --delete

# Overwrite existing files, no confirmation
php artisan s3:move --force --overwrite
```

### Migration Output

[](#migration-output)

The command provides detailed statistics:

```
═══════════════════════════════════════
          Migration Summary
═══════════════════════════════════════
┌────────────────────────────┬───────┐
│ Metric                     │ Count │
├────────────────────────────┼───────┤
│ Total Files                │ 150   │
│ ✓ Migrated                 │ 45    │
│ ⊘ Skipped (Already Exist)  │ 105   │
└────────────────────────────┴───────┘
✓ Migration completed successfully!
⊘ 105 file(s) were skipped because they already exist on S3
  Use --overwrite flag to replace existing files

```

Events
------

[](#events)

The package fires a `S3MigrationCompleted` event after migration finishes. You can listen to this event to perform custom actions:

```
// In your EventServiceProvider
protected $listen = [
    \Xerxes\S3Move\Events\S3MigrationCompleted::class => [
        YourListener::class,
    ],
];
```

```
// YourListener.php
public function handle(S3MigrationCompleted $event)
{
    // $event->migratedFiles contains the collection of migrated files
    foreach ($event->migratedFiles as $file) {
        // Update database records, clean up, etc.
    }
}
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.0, 11.0, or 12.0
- AWS S3 or S3-compatible storage

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance71

Regular maintenance activity

Popularity10

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

164d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a478360844423217c81122d0fa60a21d962022900ae1c642a9aff16a1518260a?d=identicon)[xerxes-on](/maintainers/xerxes-on)

---

Tags

awslaravelphps3laravels3awsmigrationcloudstoragefile-migration

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/xerxes-s3-move/health.svg)

```
[![Health](https://phpackages.com/badges/xerxes-s3-move/health.svg)](https://phpackages.com/packages/xerxes-s3-move)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[laravel/vapor-cli

The Laravel Vapor CLI

31310.7M8](/packages/laravel-vapor-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
