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.

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
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
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
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
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
Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate

Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector
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 →
Laravel Solr image

Laravel Solr

Read article
A Guide to Pagination in Laravel image

A Guide to Pagination in Laravel

Read article
Laravel Roundup - November image

Laravel Roundup - November

Read article
Bento Laravel SDK image

Bento Laravel SDK

Read article
Laravel 11.30 Released image

Laravel 11.30 Released

Read article
Bluesky notification channel for Laravel image

Bluesky notification channel for Laravel

Read article