Download the PHP package thinkneverland/porter without Composer
On this page you can find all versions of the php package thinkneverland/porter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thinkneverland/porter
More information about thinkneverland/porter
Files in thinkneverland/porter
Package porter
Short Description Porter - A Laravel package for data export, import, and S3 management
License MIT
Informations about the package porter
Porter Package Documentation
Overview
The Porter package allows for exporting, importing, and cloning of database and S3 bucket content, providing flexible ways to manage data for your Laravel applications.
Installation
You can install the package via composer:
Run the install command
This command will publish the configuration file, allow you to set S3 credentials, and apply necessary configurations.
During installation, you'll be prompted to provide S3 credentials for both primary and alternative (secondary) S3 buckets. These will be stored in your .env
file if not already set.
Configuration
The Porter package uses a configuration file located at config/porter.php
after running the install command.
If you wish to configure Porter manually instead of using the install command, you can do so by editing the config/porter.php
file.
S3 Storage Settings for Cloning
Primary and alternative S3 buckets for cloning operations can be configured in the porter.php
config file:
Make sure to set these values in your .env
file if you wish to enable exporting to an alternative S3 bucket.
IAM Policy Updates for S3 Multipart Uploads
Due to the addition of multipart uploads to S3, your IAM policies need to be updated to support this functionality. Ensure the following actions are allowed in your IAM policies for both the primary and alternative S3 buckets:
Make sure to replace your-primary-bucket-name
and your-alternative-bucket-name
with the appropriate bucket names. This policy ensures that Porter can manage multipart uploads effectively, which is particularly important for handling large file transfers.
Exporting Database
The porter:export
command exports the database into an SQL file. This can be stored locally or on the primary or alternative S3 bucket, depending on your configuration.
Usage:
Example with flags:
Flags:
--drop-if-exists
: IncludesDROP TABLE IF EXISTS
for all tables in the export file.--keep-if-exists
: Ensures thatIF EXISTS
is kept for all tables.- After export, a temporary download link is generated that expires after 30 minutes. The exported file is deleted after expiration.
Example Output:
Importing Database
The porter:import
command allows you to import a database SQL file from local or S3 storage.
Usage:
Example: Import from S3
Example: Import from Local File
Cloning S3 Buckets
The clone-s3
command allows you to clone content between S3 buckets as defined in your configuration.
Usage:
This will clone files from the source bucket to the target bucket as defined in your .env
configuration, including support for both the primary and alternative buckets.
Model-based Configuration
Instead of using the config file, randomization and keeping specific rows for tables are now done on the model level.
You can also ignore specific tables directly in the model to prevent them from being exported.
All versions of porter with dependencies
aws/aws-sdk-php Version ^3.0
laravel/framework Version ^10.0|^11.0
league/flysystem-aws-s3-v3 Version ^3.0