UnderHost
Knowledgebase Docs

How to migrate a MySQL database to UnderHost

Export a MySQL database from your old host using phpMyAdmin or mysqldump, then import it into your new UnderHost cPanel account.

On this page

Moving a MySQL database is a core part of any website migration. WordPress, Joomla, and most CMS platforms store all content (posts, settings, users) in the database-files alone are not enough.

Export from old host

Via phpMyAdmin (small databases, under ~50 MB):

  1. Log in to your old host's cPanel → phpMyAdmin
  2. Select your database in the left panel
  3. Click Export at the top
  4. Method: Quick, Format: SQL
  5. Click Go-save the .sql file

Via SSH/command line (large databases):

mysqldump -u username -p database_name > backup.sql

Compress large exports: mysqldump -u username -p database_name | gzip > backup.sql.gz

Create the database on UnderHost

  1. Log in to UnderHost cPanel → MySQL Databases
  2. Create a new database (e.g., newdb)
  3. Create a new database user and password
  4. Add the user to the database with All Privileges
  5. Note the full database name (e.g., username_newdb) and username (username_user)

Import the database

Via phpMyAdmin (files under ~50 MB):

  1. UnderHost cPanel → phpMyAdmin
  2. Select the new database in the left panel
  3. Click Import
  4. Choose the .sql file
  5. Click Go

For large databases (via SSH on VPS, or cPanel File Manager + command line):

mysql -u username_user -p username_newdb < backup.sql

WordPress URL search-replace

If your WordPress site's URL changes during (e.g., old host used a different domain or temp URL), you must update all URL references in the database. Use WP-CLI:

wp search-replace 'https://old-domain.com','https://new-domain.com' --all-tables

Or use the Search Replace DB PHP script-upload it to your server, run it in the browser, then delete it immediately after.

Verify the migration

  • Update your application's database config to the new credentials (e.g., wp-config.php)
  • Browse the site via a temporary URL or hosts file preview
  • Check that posts, pages, products, and settings are all present
  • Log in to the admin panel to confirm authentication works
Was this article helpful?

Let us handle the migration

Request a free migration and our team will transfer your database for you.

Related articles

Back to Migration