Importing WordPress Database Into CyberPanel

Recently, I was attempting to import an existing WordPress database into CyberPanel for a server migration. After everything was set up, and ready to import into phpMyAdmin, I get an error during the import: phpMyAdmin not using SSL.

Instead of taking the time to correct this, what’s the alternative here?

This isn’t the only way to import the SQL database. There’s always the cmd method. You should already have SSH access to the server anyways, so just knowing the commands needed will make this process go by quick.

We can just upload the compressed SQL file into a temporary directory right in our domain’s directory.

You can simply go into CyberPanel and find Websites > List websites > Manage > File Manager

CyberPanel manage website
CyberPanel file manager

You should see your public_html file here. You can create a temporary directory to hold the database. We can upload the zip file into this temporary directory. I’m just naming the directory tmp in this example.

Once the zip file has been uploaded, we can then unzip the file. You can do this right in the file manager if you want, or with this command.

unzip /home/yourwebsite.com/tmp/admin_yoursite_2024-12-06_15-32-16.sql.zip -d /home/yourwebsite.com/tmp/

Once that’s done, we just execute the mysql command to put the database right into where we want. In this case, it’s in phpmyadmin. We will need the database’s name, user, and password. Just like what is needed in a WordPress config file.

mysql -u your-db-user -p your-database < /home/yourwebsite.com/tmp/admin_yoursite_2024-12-06_15-32-16.sql

As soon as you enter the database password, it starts the import. Nothing really happens in cmd during this process. You can refresh phpmyadmin to see your import process.

That’s it!

Subscribe
Notify of
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments