How to update the database of a CMS on Fortrabbit using a local DB

Oscar de la Hera Gomez
A flower that represents CraftCMS with the text "Locally update the database of a hosted CraftCMS" beneath it.

Prepare the database, open the tunnel in Terminal and in a separate Terminal, run the mysql command, through the example of a CraftCMS hosted on Fortrabbit.

Step One: Setup the DB

A screenshot of CraftCMS demonstrating how to download a DB using the Backup utility.

To avoid the error message: ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation, we recommend that you import the DB into a DDEV instance of CraftCMS and download it through the Craft CMS Utilities.

Step Two: Open up a Tunnel

A screenshot of the Fortrabbit documentation showing you how to open a tunnel.

Navigate to the link below to learn how to open up a tunnel to Fortrabbit in Terminal.

Please note that the Examples dropdown on the top right can be updated to give you the exact line for opening a tunnel for your app.

Step Three: Import the DB

A screenshot of Fortrabbit showing where the MySQL password is found within an app.

The image above demonstrates where to find the password for the MySQL command.

Open a separate terminal and run the line below, replacing LOCAL_PATH_TO_YOUR_DB.sql with the path to the database.

mysql -h127.0.0.1 -P13306 -ucraft3-xs7n -p craft3-xs7n < LOCAL_PATH_TO_YOUR_DB.sql

You will be prompted to put in a password, input the MySQL password found in your app on the Fortrabbit website.

Looking to learn more about CraftCMS?

Search our blog to learn more about CraftCMS, design and technology.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details