WordPress is definitely the most popular versatile content management system that can be used as a blog, a website, e-commerce store and what not. Majority of WordPress based sites are hosting on Shared webhosting. This type of web-hosting service usually alternate between these 2 visual control panels (server management scripts) called cPanel and Plesk. These control panels help you manage your Website by providing a GUI for managing MySQL databases using phpMyAdmin, creating Virtual hosts on Apache/NGINX (adding domains) and shuffling between PHP versions.
Control Panels are not free, they come with expensive monthly licensing fees. Shared hosting providers pay this amount in bulk. Or if you have a standalone VPS server, you can buy licence and setup your own but that’s a different topic. Note that there are free alternatives too such as; Cyberpanel (1 domain), VestaCP, ISPConfig and CentOS Webpanel.
While these panels are often robust and reliable but like every computer program they have problems either due to wrong configuration, version mismatch or bugs. In this article, I will to show you how to backup/restore WordPress MySQL database without using phpMyAdmin.
- This only works on a functioning website which is accessible through IP or Domain Name
- You must have valid Database Name, User and Password to generate backups or import one.
PHP: Version 5.0+ , PHP 7.2, 7.3 any 7.0+ version will do.
Supported Database Servers: MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, SimpleDB, Elasticsearch or MongoDB.
FTP Access or cPanel/Plesk File Manager: For uploading a file to document root.
How to Backup/Restore your WordPress site Database without phpMyAdmin
Download the latest version of Adminer database management tool from here. It’s a few kBs .php extension file.
Now we need to upload the Adminer’s php file to and make it access from our website. This can be done through Filezilla FTP client or you could simply upload it through cPanel/Plesk File Manager.
Note: The adminer-4.7.6.php file must be in the Document root. It is the directory where the WordPress’s [wp-content, wp-uploads and wp-config.php] are stored. The folder usually has same name as your domain name.
Make sure that the file is accessible through Domain or IP. Example:
http://YourWordpressDomain.com/adminer-4.7.6.php ---- OR ---- http://220.127.116.11/adminer-4.7.6.php
It should show a Adminer Login page asking you for MySQL credentials.
Leave the Database Server to localhost, don’t change it. Then enter the full database name, User and password and click login. If you don’t have the login details, don’t worry you can re-acquire them from wp-config.php file that is found in root directory of your WordPress site.
cPanel example path to WordPress configuration file:
/home/YourUsername/public_html/wp-config.php --- OR ---- /home/YourUsername/DomanName.com/wp-config.php
Here’s what the inside contents of file look like. In the red squared section, you can see the all the required MySQL credentials defined in a proper way. Just carefully copy and paste them into their appropriate text fields on Adminer’s login page, without quotes.
After clicking Login, Adminer will list all your Database tables and what’s inside them. It’s basically a tiny version of phpMyAdmin but more powerful. You can analyze, check, repair, optimize and delete tables. But right now, we’re doing backups!
From the top left side, click Export Link.
On Adminer Export page, select ‘save‘ radio button on Output and click Export.
You will then be prompted to save the backup of your WordPress database YourDBName.SQL extension file which can later be imported (restored) using the Import function in Adminer. Easy right? Don’t forget to delete or move adminer.php after your work is done, to avoid security loopholes.
Let me know if you face any problems, I’ll try my best to respond.