Knowledge Base
MilesWeb / How-Tos

Learn how to Backup or Export the Database from SSH

Approx. read time : 2 min

Today we will see how you can export the database from SSH. This can be useful in situations like moving your site, as it can help you to export the entire database, or need to upgrade a website.

Generate a Database Backup:

Step 1: Connect to your server via SSH.

Step 2: In the command line enter the following code:

Make sure you replace:

dbusername = with the database username for the database you want to export.

databasename = with the name of the database you want to export.

nameofdbbackup = enter a name for the exported database.

Step 3: Once you Press the Enter key, it will ask you for your password. Provide your password and press Enter key again, the exporting process will begin. It may take some time to complete the process, depending on the size of your database. The SSH client will take you to the new line when this process is completed and the database will now be available for download in your home directory.

Related: How To Login to Your Server By SSH?

Pravin is Journalist Specializing in Blogging, Social Networking and Community Management. As a constant learner, he is always aiming towards new ideas and greater knowledge. When he is not doing research, reading, or writing for blogs, you can find him hanging around social media sites.