Migrating from Sail
How to migrate from Laravel Sail to Herd
If you’re currently using Laravel Sail for local development and want to switch to Herd, this guide will walk you through the migration process. While both tools provide excellent development environments, they have different approaches to managing services and dependencies.
Understanding the Differences
Laravel Sail uses Docker containers to provide isolated development environments, while Herd takes a native approach by running services directly on your machine. Here are the key differences:
Laravel Sail
- Uses Docker containers
- Requires Docker Desktop
- Services defined in docker-compose.yml
- Container-based isolation
Herd
- Uses native services
- No Docker required
- Services managed via Herd UI/CLI
- Native performance
Migration Steps
1. Stop Sail Services
Before switching to Herd, make sure to stop all running Sail containers:
2. Install Herd
Download and install Herd from the official website. Follow the installation instructions to get Herd up and running on your machine.
3. Update Environment Configuration
Your .env
file likely contains Docker-specific configurations. Here’s how to update common settings:
Database Configuration
If you’re using MySQL:
Redis Configuration
If you’re using Redis:
Mail Configuration
If you’re using Mailhog with Sail, switch to Herd’s mail service:
4. Set Up Required Services
If you’re using Herd Pro, you can install services directly from the Herd UI. The free version requires manual installation of additional services.
Review your docker-compose.yml
file to identify which services your application needs. Common services include:
- Database (MySQL/PostgreSQL)
- Redis
- Meilisearch
For Herd Pro users, you can install these services via the Services tab in settings. Free version users should install these services separately.
5. Remove Sail Dependencies
You can now remove Sail from your project:
Also, clean up Sail-related files:
docker-compose.yml
docker/
directory- Any custom Dockerfile configurations
6. Update Development Scripts
Update your composer.json
scripts section to remove Sail commands. For example:
7. Create Herd Configuration (optional)
Create a herd.yml
file in your project root to define project-specific configurations either manually or by running herd init
:
8. Initialize the Project
Initialize your project with Herd:
This command will configure your project according to the herd.yml
file and set up any required services.
Common Challenges
Database Migration
If you need to migrate your data from Sail’s MySQL container:
- Export your database from Sail:
- Import into Herd’s MySQL:
File Permissions
Since Herd runs services natively rather than in containers, you might need to adjust file permissions:
Using Herd in a Team
When working with a team, make sure to:
- Share your
herd.yml
configuration file via version control - Document any specific service requirements
- Standardize PHP versions across the team
Getting Help
If you encounter issues during migration:
- Check the troubleshooting guides
- Join the community support
Herd Pro users can also access priority email support for migration assistance.