I want to Transfe mysql database to another server without backup is it possible using some script? Or I have to do it manually?
I want to Transfe mysql database to another server without backup is it possible using some script? Or I have to do it manually?
Its not possible without backup.You have to take backup at your end only.And also you have to do manually only![]()
While you're right as far as I know, anything that is done manually that does not require user input can be automated through the use of the cron command:
server #1 - [where the backup is being taken]
mysqldump --add-drop-table -h mysqlservername -u dbocodex -p yourpassword > filename.sql
[ insert your rsync, ftp, or scp commands here ]
server #2 - [where the backup is being restored]
mysql -h secondmysqlservername -u mysqlusername
-p databasename < filename.sql
To move a mysql db you will need a backup. So you either need command line access or a very easy tool to use is phpMyAdmin, which most hosts offer through cPanel.
But to move a db you do need a dump file as jcy1978 gave you instructions on how to get from the command line.
From phpMyAdmin select the database
Click the Export tab
Make sure the Data box is check and Complete inserts
Check the box Save as file
Then click go
This will download the __DB__.sql file which you will use to import into the new db on the other server.
Mark
Bookmarks