How to Transfer a MySQL Database to a New Server

Migration · 15.01.2025
How to Transfer a MySQL Database to a New Server

Exporting the Database

Via phpMyAdmin

  1. Log in to phpMyAdmin on your old hosting
  2. Select the database you need
  3. Go to the Export tab
  4. Choose SQL format and click Go
  5. Save the .sql file to your computer

Via SSH (mysqldump)

mysqldump -u username -p database_name > export.sql

Importing on the New Server

Via phpMyAdmin

  1. Create a new database in cPanel
  2. Open phpMyAdmin, select the new DB
  3. Go to the Import tab and upload the .sql file

Via SSH

mysql -u username -p database_name < export.sql
← Back to Knowledge Base Ask Support