Copy MySQL database from one server to another remote server
Our Magento Shop working some period usually coming with very large Datebase.When you need transfer hosting its big problem on transfer this database to your new hosting.
Follow is introduce my experience on how transfer Magento Mysql Database from one server to another remote server:
Option A
Click the database that you wish to backup (eg. d01234567)
Click Export
Click the appropriate option:
-Structure only
-Structure and data (recommended)
-Data only
Click the “Save as File” option
Click the “Go” button
This is for small database file transfer.
Option B
If your database is too large to backup via phpMyAdmin, you may backup the database through an SSH session if your plan supports it (SSH available on Advantage and Business plans):
Your MySQL databases can be administered through an SSH session via command line (especially if you have large sized data to import/export):
First, turn SSH on for your account:
1. Login to the Control Panel
2. Click Hosting
3. Click Settings
4. In the SSH section, use the pull-down menu to enable SSH if it’s not yet enabled
5. Then find an SSH client such as WinSCP (available for free from http://prdownloads.sourceforge.net/winscp/winscp380.exe?download )
SSH connections can be established with the following login credentials:
Username
Password
Host: Your hosting IP(port 22)
6. Using Netfirms File Manager or the touch command in SSH, create a file called dbBackupFile.sql. The file may reside anywhere inside your /www folder.
7. To make a backup copy of your mysql magento database via a SSH session:
%/usr/local/nf/bin/mysqldump -e –force –quick -h mysqlhost -u Username -pPassword DatabseID > dbBackupFile.sql
(You will then be prompted to enter your database password.)
Option C
You may use a PHP or Perl script to backup your Magento MySQL data.
The following sample codes (you can name the file dbBackupFile.php in place it inside your www folder) will create a backup .sql file of your database inside your www folder:
PHP
backup.sql”;
exec($command,$error);
if ($error) {
echo “Error: “. $error;
}
?>
Perl/CGI
#!/usr/bin/perl
print “Content-type: text/htmlnn”;
$cmd=system “/usr/local/nf/bin/mysqldump -uu70459875 -p8c2f28 d60417018 > perldbbackup.mysl”;
if ($cmd)
{
print “Error!!!!”;
}
else
{print “Sucess!!!!”;
}
Option D
SCHEDULING YOUR MAGENTO DATABASE BACKUPS
To create a cron job to schedule your database backups please click here for further instructions.