Transferring MySQL database to new server::

While gettting transferred from one host to another you need to take many precautions one of them is of your database (MySQL)

You should backup all your database files before it is transferred. You can do it so using two methods : 1) Using third party tool such as PhpMyAdmin.

2) Using ” dump” tool which comes bundled with MySQL.

Using PhpMyAdmin :

It is a PHP script which gives ability to interact you database.
To manage and manipulate MySQL databases use options under “export” section of  PhpMyAdmin. Select the appropriate database and zip up the files it can save you bandwidth and time to download the backup file.
Now to transferring onto new server, first create a new database, unzip files and extract the backup then restore your database.
It also lets you mess up the database directly. There is no “undo” or “undelete” in your database. Always exercise caution when working with the database.

Most host have their control panel PhpMyAdmin pre-installed.

Using dump tool :

You have to use different commands at command line environment or UNIX shell environment.

Type command :

mysqldump -u [username] -p [password] –opt [databasename] > backup.sql

this command will take backup of your database.

Now on the new server, you can restore the database by inputting the following command:

mysql -u [username] -p [password]
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.

Share on Twitter
Share on Facebook