How can I migrate large database files ?

If you have large database file, which you want to import, but you are not able to do so, through the database manager, you can try the following method to import the database via the SSH command line console. You might a server timeout error while importing a large database file or any other file, this is due to certain server security settings. To avoid these errors and to import the database, you can also try the following :
Step 1 : Enable the SSH Console access for the site you wish to import the database to. You can enable and login to the SSH console as mentioned here : Enable SSH access

Step 2 : Open the 'wp-config.php' file from the 'public_html' folder of the site. You can use any editor to open the wp-config file with. For this example we will be using the 'nano' editor.

nano wp-config.php

You should see the database details in the file like this

define('DB_NAME', 'd_2APK3T');
define('DB_USER', 'u_2APK3T');
define('DB_PASSWORD', 'JfdrrzybIvCBh');
define('DB_HOST', 'localhost');
$table_prefix  = 'wp_';

Note down the 'DB_USER', 'DB_PASSWORD' and 'DB_NAME' values.

Now exit the 'nano' editor using control+x key combination (Remeber this command will be different if you are using a diffrent editor)

Step 3 : Next download the large database file which you wish to import to the site's public_html folder. You can do this via sftp manager like 'FileZilla' or through SSH command line using the 'wget' or 'curl' commands.
For example :

wget http://_URL_of_file

Step 4 : Next we will use the 'mysql' command to import the database into the site database. It is advisable before doing this, that you backup the current database.
To import the database, we will use the database details that we got from step 2.

mysql -u {DB_USER} -p{DB_PASSWORD} {DB_NAME} < name_of_the_file_to_be_imported

Please note that there is no space between '-p' and the database password.

If you an error like, the table already exists, you can try again after deleting all the database tables from the Database manager.

If you are still unable to import the database, please feel free to contact our support team, and we will be happy to do it for you.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 WPOven Inc. All rights reserved. WPOven® and WordPress® are registered trademarks.
WPOven is the best Managed WordPress hosting for agencies and businesses that want to succeed. With Unlimited sites hosting option, its easy to use and manage, so you can focus on growing your business. 
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram