Skip to main content

Export & Import your SQL Database

Step 1: Get Database Connection Details from Pterodactyl Panel

  1. Log in to Pterodactyl Panel:

    • Login into your account on the panel, if you haven't
  2. Access the Server’s Database:

    • Go to the server where the database is allocated at.
    • Find and click on the "Databases" tab inon the left-sidenavigation menu.image.png

Here, to export/import a database file (.sql format), click on one of the 2 buttons.

image.pngimage.png

Exporting

Click on Export Database to SQL.

Now select a database to export (here it's s459_example)

image.png

Now press Export Database to SQL on this pop-up, and it will automatically download for you.

image.png

Importing

Click 3.on CopyImport SQL to Database

You will be prompted to the Connectionfollowing Information:

pop-up
  • Here, you'll see details like(toggle the host,options port,you databaseneed)

    name,

    image.png

    username,

    Click andImport passwordLocal forSQL into Database

    It will bring a new pop-up where you can find your database..sql

  • image.png
  • Copy these details, as you’ll need them to connect with HeidiSQL.

Step 2: Set Up HeidiSQL

  1. Open HeidiSQL:

    • Launch the HeidiSQL applicationfiles on your computer.
  2. Create a New Session:

    • Click New on the bottom-left side of the program.
    • image.png
  3. Enter Connection Details (obtained on step 2):

    • Under Network Type, select "MySQL (TCP/IP)."
    • For Hostname/IP, paste the host you copied from the Pterodactyl panel.
    • Enter the port number.
    • Enter the username and password from the Pterodactyl database details.
    • For Database, enter the database's name
    • image.png
    • It should look something like the image above
  4. Save and Connect:

    • Click on Save, then Open to connect to the database.
    • If your details are correct, HeidiSQL should connect to the database successfully.

Step 3: Export a Database in HeidiSQL

  1. Select the Database:

    • In HeidiSQL, select the database you want to export from the list on the left.
  2. Export Database:

    • Right-click on the database name, then go to Export Database as SQL.
    • Choose where to save the SQL file and adjust any export settings you need (e.g., data, structure, etc.).
    • Click Export to save the SQL file to your selected location.
    • image.png
    • image.png
  3. Check Exported File:

    • Go to the saved location and check that the .sql file was created successfully.

Step 4: Import a Database in HeidiSQL

  1. Select the Target Database:

    • Make sure you are connected to the server and have selected the database you want to import data into. (Step 2, but with the database you want to import data into).
  2. Open SQL File:

    • Click on the File menu in HeidiSQL and select Load SQL file.
    • Locate the .sql file you wish to import and open it.
    • image.png
  3. Execute Import:

    • The SQL commands from the file will load in the SQL Query window. Click Run to execute the commands, which will import the data and structure into the database.
  4. Verify Import:

    • Once the process completes, check the tables and data to ensure everything imported correctly.