To make a backup copy of your mySQL database, please follow these steps:
Option A
1. Login to the Members Control Panel at https://controlpanel.netfirms.com
2. Click Site Tools
3. Click Database
4. For the database you wish to backup, click Admin
5. Click phpMyadmin
6. Click the database that you wish to backup (eg. d01234567)
7. Click Export
8. Click the appropriate option:
-Structure only
-Structure and data (recommended)
-Data only
9. Click the "Save as File" option
10. Click the "Go" button
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 Netfirms Control Panel
2. Click Site Tools
3. Click SSH
4. Click Enable
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: ssh.netfirms.com (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 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 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
<?php
$command = "/usr/local/nf/bin/mysqldump -hmysqlhost -uUsername -pPassword dbid > 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 DATABASE BACKUPS
To create a cron job to schedule your database backups please click here for further instructions.