How to Migrate MySQL from DBngin to Laravel Herd

Last updated on by

How to Migrate MySQL from DBngin to Laravel Herd image

Ever since Laravel Herd Pro was launched with the ability to manage database and cache services like MySQL, Postgres, and Redis, I've been wanting to switch from DBngin to Herd's MySQL and Redis.

Recently, with a little help from Marcel Pociot, I was able to figure out an easy way to move all my local databases over to Herd's MySQL service without losing any data.

Warning before getting started, if you have any databases that are really important and you can't risk losing them, make a backup before following any of these instructions. I'm not responsible if something goes wrong and you lose some important data.

Note: this method will only work if your MySQL services are on the same minor release version. For example: v8.0.33 to v8.0.36 will work. v8.0 to v8.2 will not work.

1. Stop DBngin's MySQL service.

To stop DBngin's MySQL service, open the DBngin app and click stop beside the MySQL service.

2. Create the MySQL service in Herd

Open Laravel Herd, and go to the "Services" tab. Click "Add Service" and create the MySQL service. I would suggest stopping the Herd MySQL service after it's added so we can safely move the data without corrupting anything.

3. Copy the data from DBngin to Herd

First, you need to find out where DBngin stores all your database files. I found them the hard way, but Marcel told me an easier way. Open DBngin, right-click on the MySQL service, and click "Show database files". It should open a "mysql" folder that has a single folder inside. Open that folder, and you should see a folder for every database you have, plus some other configuration files and folders.

To find out where Herd plans to store your databases, we can follow a similar path. Open Herd's "Services" tab again, right-click the MySQL service, and click "Open data directory". It should open the exact folder where it stores the files.

Now, copy all the files and folders from the DBngin folder to the Herd folder.

4. Restart the MySQL service in Herd

Once all the files are copied over, open up Herd to the "Services" tab and restart the MySQL service. Open up your database management tool of choice, connect to the MySQL service (probably using the same settings you were using previously), and you should see all your databases listed!

Now, if you want to, and you're not using DBngin for other services (or have migrated them all to Herd), you can uninstall DBngin. One less app/service to maintain on your Mac.

Conclusion

I've really been enjoying the simplicity Herd and Herd Pro bring to the Laravel development experience. It's so simple to set up and includes pretty much everything needed for typical Laravel development these days. I can't wait to see what they add next!

Let me know what your favorite Herd features are on Twitter.

Jason Beggs photo

TALL stack (Tailwind CSS, Alpine.js, Laravel, and Livewire) consultant and owner of designtotailwind.com.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

Curotec logo

Curotec

Hire the top Latin American Laravel talent. Flexible engagements, budget optimized, and quality engineering.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Laravel Forge logo

Laravel Forge

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Forge
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Join the Mastering Laravel community logo

Join the Mastering Laravel community

Connect with experienced developers in a friendly, noise-free environment. Get insights, share ideas, and find support for your coding challenges. Join us today and elevate your Laravel skills!

Join the Mastering Laravel community
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Solo Dumps for Laravel image

Solo Dumps for Laravel

Read article
Download Files Easily with Laravel's HTTP sink Method image

Download Files Easily with Laravel's HTTP sink Method

Read article
Aureus ERP image

Aureus ERP

Read article
Precise Collection Filtering with Laravel's whereNotInStrict image

Precise Collection Filtering with Laravel's whereNotInStrict

Read article
Configuring Middleware in Laravel image

Configuring Middleware in Laravel

Read article
Come for the Simplicity, Stay for the Extensibility: Identity with FusionAuth image

Come for the Simplicity, Stay for the Extensibility: Identity with FusionAuth

Read article