Last modified: Aug 26, 2020 Show
OverviewThis article will show you how to export a copy of your MySQL database, and how to import an SQL database backup file to your database server. This is useful for making personal backups of your site, and for importing backups from other servers. Advanced Support can help! If you're having trouble with the steps in this article, additional assistance is available via Advanced Support, our premium services division. For more information on what Advanced Support can do for you, please click here. READ ME FIRST InstructionsIf you require a refresher on accessing phpMyAdmin, feel free to review the documentation below:
ExportNOTE:
ImportCAUTION:
wp-configIf you have a WordPress site, you may need to update the the table prefix. This is done by editing the wp-config file that exists in your site root. You will need to look for a line that looks similar to the following and modify it.
You will need to replace the existing table prefix in the wp-config.php file
with the one from your previous host. For example, if your tables looks similar to the following:
Once the content is uploaded, the database is imported, and the database table prefix in the wp-conf file is updated, your site should be migrated. Command LineLarger databases may require you to export/import directly from the command line. Exporting a MySQL database1. Connect to your server using SSHSSH. 2. Navigate to the /html directory.
3. In order to export your database, we'll need information that is located in wp-config.php.
4. Use mysqldump to create a copy of the database.
If you do not specify a directory when creating your database backup, the SQL file will be placed in the /html folder. If you choose to do this, make sure that you move the SQL backup soon after creating. /html is a web accessible directory and your database backup may be downloaded by anyone. This will create a copy of your WordPress database and place it in the specified directory. You may then use SCP or FTP to download your database. Importing a MySQL database1. Upload your database to the server using FTP. 2. In order to import your database backup, we'll need information that is located in wp-config.php.
3. Use mysql to import your database.
This should have imported your database. If needed, be sure to remove the uploaded SQL file from your web-accessible directory (/html). Otherwise, anyone can download it from the web. WP-CLIExport a MySQL databaseBefore starting, keep in mind that to use wp-cli for database export or import, your site must have WordPress 3.7 or later, and a correctly configured wp-config.php file.
Import a MySQL databaseMake sure the database you need has already been created. If it has not, please first create the database: Caution:
For additional information on using wp-cli for the export and/or import of databases (including possible variables) feel free to review the third-party resources below:
Command LineThis method works for all database sizes, including very large ones. You must be able to log into your server with SSH. Please see this article for details: Connecting via SSH to your server. Export a MySQL database
If you get an error that looks like this:
This means you have entered an incorrect password. Please retype it carefully, or reset your password via the AccountCenter Control Panel. See Database users on the Grid for instructions. Import a MySQL database
If you get an error that looks like this:
You have entered an incorrect password. Please retype it carefully, or reset your password via the AccountCenter Control Panel. See Database users on the Grid for instructions. If you get an SQL error during the import, you can force it to finish by adding "-f" to the command, which stands for "force." For example:
This can help you finish an import if you have a few corrupt tables, but need to get the database as a whole imported before you do anything else. If your import still fails, check the .sql file for “create table” lines. If they exist, comment them out using a '#'. Grid hosting is a shared environment and users do not have create table permissions. WP-CLIExportBefore starting, keep in mind that to use wp-cli for database export or import, your site must have WordPress 3.7 or later, and a correctly configured wp-config.php file.
Import
InstructionsCommand LineThis method works for all database sizes, including very large ones. You must be able to log into your server with SSH.
Export
If you get an error that looks like this:
This means you have entered an incorrect password. Please retype it carefully, or reset your password in the AccountCenter. See How can I change my Plesk admin password? for instructions. Import
If you get an error that looks like this:
You have entered an incorrect password. Please retype it carefully, or reset your password in the AccountCenter. See How can I change my Plesk admin password? for instructions. If you get an SQL error during the import, you can force it to finish by adding "-f" to the command, which stands for "force." For example:
This can help you finish an import if you have a few corrupt tables, but need to get the database as a whole imported before you do anything else. If you run into file size errors you can try to increase the server's limit through the php.ini file. Plesk has an article on the topic here. How do I export selected data from phpMyAdmin?Before you begin. Log into phpMyAdmin.. Select the source database on the left pane.. Click on the Export tab in the top center pane.. On the next page you must select a Quick or Custom export method. ... . From the dropdown menu, choose the format you'd like to save the file as. ... . Click the Go button to continue.. How do I export from phpMyAdmin to excel?You don't need a plugin to copy and paste to Excel.. In phpmyadmin select the table you want to export the schema from.. Click on Print View at the bottom of the page.. Select the entire (or partial) table and click ctrl-c to copy.. Open a new Excel worksheet and select the first cell.. Click ctrl-v to paste.. How do I export a CSV file from phpMyAdmin?To use phpMyAdmin to export data, follow these steps:. Log in to phpMyAdmin using a user that has required permissions. Navigate to the database which contains the source table as shown.. Choose the table from the database. Click on Export in the top bar.. Choose the CSV format from the format dropdown menu. Click on Go.. How do I import and export from phpMyAdmin?Export. Connect to your database using phpMyAdmin.. From the left-side, select your database.. Click the Export tab at the top of the panel.. Select the Custom option.. You can select the file format for your database. ... . Click Select All in the Export box to choose to export all tables.. |