Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

AtomCoder's avatar

How to Add Existing Database to Forge?

Hi Guys,

I've just started using Laravel Forge (Fantastic service). I've setup my server and have my site up and running. However, I cant seem to figure out how to import my existing database data to my new database. Cant someone point me in the right direction?

0 likes
7 replies
tykus's avatar

Do you use a GUI; TablePlus, Sequel Ace, etc?

Or, are you comfortable on commandline?

AtomCoder's avatar

@tykus Using table plus at the moment, not very comfortable on command line regarding database interactions.

tykus's avatar
tykus
Best Answer
Level 104

@AtomCoder you can connect to the remote database over SSH using your key (assuming you have added your public key to the server in Forge).

In TablePlus

  • create a new connection
  • enter the 127.0.0.1 for the Host
  • enter the 3306 for the Host
  • enter the remote database username in User
  • enter the remote database password in Password
  • click on Over SSH
  • enter the remote server IP address in Server
  • enter 22 in the port (assuming standard SSH port)
  • enter forge for User
  • click Use SSH Key and select you private key (matching the public one in Forge)
  • test the connection, and save if successful

Working?

tykus's avatar

Next depending on what you need, you can either Backup the original (local?) database or you can create an Export of the selected tables' content as SQL. Then Import the resulting SQL file into the remote database.

AtomCoder's avatar

@tykus That did the trick. I had issues importing the data, duplicate keys in some tables etc...

Please or to participate in this conversation.