Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk5 min

How to Move Laravel Uploads to S3 Without a Planned Downtime Window

Use Laravel 13’s read-through disk to send new uploads to S3 while older local files remain readable, then choose lazy promotion, explicit copying, or moves for the remaining inventory.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Laravel 13’s read-through filesystem lets an application write new files to S3 while continuing to find older files on local storage: it checks S3 first, then reads a local fallback and promotes a matching file to S3. For files you want to transfer deliberately, use copyToDisk to retain the source or moveToDisk to remove it after the move. This supports a gradual migration, but it does not eliminate every concurrency or cutover risk.

The APIs discussed here are documented for Laravel 13.x. Check the filesystem methods available in your application’s Laravel version before adopting the examples. Laravel 13.x filesystem documentation

As an Amazon Associate I earn from qualifying purchases.

How read-through migration works

A read-through disk combines a primary disk and a fallback disk. During migration, configure S3 as primary and the existing local disk as fallback. Laravel checks the primary first; if the file is found only on the fallback, a qualifying read can promote it to the primary. Writes and directory listings target the primary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That means the application can keep serving older files while new writes go to S3, provided application code uses the composite disk and the underlying disks are reachable. Laravel describes read-through disks as a way to migrate files between disks without downtime, but the phrase should not be read as a guarantee that every race, outage, or cutover concern disappears. Laravel’s migration article

Prepare the two disks

Inventory local storage and file paths

Identify the disk and root that currently hold uploads, whether files are public or private, and how the application stores their relative paths. Preserve the existing path convention where possible: filesystem operations resolve paths relative to each disk’s configured root.

Configure and verify S3

Laravel’s S3 driver requires the league/flysystem-aws-s3-v3 adapter. Configure the bucket, region, and credentials in the application’s filesystem configuration. Laravel also documents S3-compatible services using provider credentials and an endpoint; check the selected provider’s current requirements. Laravel filesystem configuration

Add a read-through disk

Once both underlying disks are configured and reachable, add a composite disk. This is the documented configuration shape; use the actual names from your application:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
'assets' => [
    'driver' => 'read-through',
    'primary' => 's3',
    'fallback' => 'legacy-local',
],

Laravel permits disk names or inline disk configuration arrays for the primary and fallback. Point the application’s intended storage path at the composite only after the underlying disks are ready. Laravel’s read-through configuration example

Route uploads through the composite disk

New uploads must use the intended disk. Laravel’s uploaded-file store method accepts a disk name and returns a path relative to that disk’s root. Code that explicitly names the old local disk can bypass the composite, even if the application’s default disk has changed. Find and update those explicit references. Laravel request and uploaded-file documentation

Keep database references and callers aligned with the relative paths stored by the application. Validate that files written through the composite land on S3 and that existing local paths remain readable before proceeding with bulk transfer.

Choose lazy promotion, bulk transfer, or both

Let reads promote active files

When a file is read from the fallback, Laravel can copy it to the primary for later requests. This gradually transfers files users still access, but cold files remain on local storage until read. A metadata or existence check is not a migration: exists, metadata checks, and visibility checks inspect primary and then fallback without promoting the file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Copy files when the local source must remain

For an explicit transfer that retains the source, use copyToDisk:

Storage::disk('local')->copyToDisk('s3', 'reports/report.csv');

Move files when source removal is intended

moveToDisk transfers across disks and removes the source when the move succeeds. Its optional third argument specifies a different destination path:

Storage::disk('local')->moveToDisk(
    's3',
    'reports/report.csv',
    'archive/report.csv'
);

Use a move only when deleting the source is the desired outcome; choose a copy workflow when the local version must be retained. Check error handling and cleanup behavior in your target Laravel release. Laravel’s migration article notes that a failed fallback cleanup during a read-through move surfaces as an UnableToMoveFile error. Laravel filesystem methods

Inventory the fallback directly for bulk work

A read-through disk’s directory listing reports primary contents only. A bulk job that lists the composite will therefore miss files that still exist only on local storage. Enumerate the fallback disk directly, then skip paths already present at the destination to avoid redundant copies or overwrites.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a bulk worker, also define how it handles duplicate processing and application writes occurring during transfer. Those are operational safeguards, not guarantees supplied by the filesystem API.

Consideration Read-through promotion Explicit bulk transfer
When transfer happens When a qualifying read accesses the fallback file When a worker or operator processes the path
Cold files Remain on fallback until read Can be migrated without a user read
Source retention Promotion copies fallback data to primary copyToDisk retains the source; moveToDisk removes it after a successful move
Inventory Composite listings show primary state only Enumerate fallback directly and skip paths already at destination
Concurrency A documented race remains for mutable paths between the last primary check and promotion write Define safeguards for concurrent application writes and duplicate job processing

The read-through behavior and transfer methods are documented by Laravel; the bulk-worker concurrency guidance is an operational precaution. Laravel migration guidance

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Account for failure and concurrency behavior

Do not treat fallback as general S3 outage failover

If checking or reading the primary fails, Laravel’s migration article says the failure remains a primary failure rather than triggering fallback. The fallback is for files absent from the primary, not a general recovery path for a broken or unavailable S3 connection.

Handle promotion failures deliberately

By default, a failed promotion does not fail the read. Laravel documents the throw_on_promotion_failure option for applications that want promotion failures to throw. Choose how the application will observe and remediate failed promotions rather than assuming successful reads prove migration succeeded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Protect mutable paths

Read-through performs another primary check before promoting a fallback file, but that final check and the write are separate operations. A concurrent overwrite can still race with promotion. Immutable or versioned keys, or coordinating writes during migration, reduce the risk. Once a path has been promoted, later changes made only to the fallback are no longer visible through that path.

Verify URLs, visibility, and access

Moving bytes does not guarantee that existing links or access rules continue to behave the same way. Laravel’s documented public-local setup uses storage/app/public and exposes it through the public/storage symbolic link. S3 URL behavior differs, so verify destination visibility, URL generation, and any CDN or custom-host configuration against how the application serves files. Laravel URL and visibility documentation

Retire local storage only after verification

Do not use user traffic alone as proof that migration is complete: cold files may never have been promoted. Before removing the fallback, process its inventory and verify that destination objects are readable with the expected metadata and visibility, application references still resolve, and no process continues to write to the old store. These checks follow from the documented primary-only listing and routing behavior; Laravel does not prescribe a universal retirement checklist.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.