How do I import a Database with Plesk?
Complete the following steps to import your dumpfile:
- Log in to Plesk and choose the Databases button. If presented with a list of domains, choose your domain in the list
- Create a database by clicking "Add New Database" then add a database user. Make sure you keep the database name, username and password handy
- Use the Plesk Import Utility (available in Plesk 12.5+)
- Under the database you just created, choose the "Import Dump" button
- If the database file you'll be importing is on your computer, click "Choose File" and select the database file. If the database file has already been uploaded to the server, choose "Import" then navigate to and select the database dump file to import it
- Proceed with the import. Note that the 'recreate database' option shown here will erase everything in the database on the server before importing the content. This is fine since it's brand new and you have nothing in it, but if you happen to be using an existing database in Plesk, be careful with this option!
- Use phpMyAdmin (alternate option for importing)
- Choose the "DB Web Admin" or "WebAdmin" button to load phpMyAdmin. If nothing happens, ensure your browser is not blocking popups for the page (each browser is different so, if you don't know how to do this, please search Google for information on disabling your pop-up blocker for your browser)
- If you see the name of your database on the left, click on it to select it. If not, then it is likely already selected by default
- If there is an "Import" tab along the top, click that. If you do not see "Import", click on "SQL" and then the Import tab
- Click on the browse button near the bottom to select the db dump on your computer. The rest of the settings can normally remain at their defaults. Choose OK or GO.
If you were unable to use the same database name, username, or password when you created the database in Plesk as it was named previously, then you will need to adjust the configuration of your web application that is using the database to ensure it contains the new database information to connect to. Look in your application's files for a configuration or config file (PHP apps often use config.php for example) and update the database connection details found within to the new database name, Username and Password.
Commonly Requested Config File Locations:
- WordPress: wp-config.php
- Joomla: configuration.php
- Magento: app\etc\local.xml
If your app isn't in the list, do a Google search or check their documentation!
If you receive error #1007 or any notice indicating the database already exists, open the .sql dump on your computer with a text editor (notepad for example) and remove the line near the beginning of the file that starts with "CREATE DATABASE" then try uploading again.
If you receive any other errors or encounter any problems with these steps, please open a support request that describes what you have attempted and at which step you have encountered a problem. It is suggested that you upload the database file to your "private" folder using FTP and let us know that it is there. If we have to manually import your database, it will make the process much faster.
- 15 Users Found This Useful