| There are a couple of methods that you can employ to backup or/and transfer your existing MySQL database(s) to another server. You can either use a third party tool or use the in-built dump tool bundled with MySQL.
Firstly, your can use the free PhpMyAdmin web-based tool that your web host may already have installed, or you can install yourself. PhpMyAdmin is a MySQL administration tool written in PHP to manage and manipulate MySQL databases. This option is available under the “export” section of the PhpMyAdmin. It is important to select the appropriate database (if you have more than one), choose the “SQL” format and I also highly recommend that you zip the file up as it can save you bandwidth and time to download the backup file. On the new server, just create a new database and restore the database from the SQL backup - remember to unzip the file and extract the backup before restoring it.
Another method is to use the MySQL dump tool that comes with the initial installation. All you have to type in the command line environment or UNIX shell environment is:
mysqldump -u [username] -p [password] --opt [databasename] > backup.sql
On the new server, you can restore the database by inputting the following command:
mysql -u [username] -p [password] < backup.sql
The options in brackets need to be filled out with the appropriate information, such as, the username and password. It is also a good idea to take a "dump" of your database regularly for backup purposes in case the server fails or you have a corrupt database.
|