Previous Thread
Next Thread
Print Thread
Rate Thread
#104246 07/19/2001 12:32 PM
Joined: Aug 2000
Posts: 299
Member
Member
Offline
Joined: Aug 2000
Posts: 299
How do you move a mysql database to another server?

I am going to change server and I want to know how do I do that.

Sponsored Links
#104247 07/19/2001 4:30 PM
Joined: May 2001
Posts: 254
Member
Member
Offline
Joined: May 2001
Posts: 254
This should do it


Step One - Backup current database:

Telnet into your system
from the root directory, type mysqldump -uUSERNAME -pPASSWORD databasename > /path/to/dump.sql
this should only take about than 30 seconds to a few minutes, depending on your database size
when it is completed, it will bring you back to the prompt
verify that you have a dump.sql in the /path/to area you specified


Step Two - Transfer to new server

telnet into machine1, and from the command prompt type the following:
machine1$ cd /path/to/yourbackupdirectory
machine1$ ftp machine2 (IP or host) - this should open a connection and ask for your username/password
ftp> bin
ftp> cd /path/to/newdirectory
ftp> put dump.sql (should take no more than 30 seconds to a few minutes, depending in the file size)
ftp> close
ftp> quit
verify dump.sql is in the /path/to/new area on the new server

Step Four - Restore to new server

telnet into machine
create new database on the mysql (either via phpMyAdmin or telnet)
from the root, type mysql -uUSERNAME -pPASSWORD newdbname < /path/to/dump.sql
this takes a couple of minutes depending on your database size, but you can track the progress either by FTP (checking the /mysql/data/newdbname and see the files appearing) or by phpMyAdmin (you should see the files appearing there)
when it is completed, it will bring you back to the prompt


QUOTES: by Link2001-------------------------"I see under the road.""When will the path end?""Boy Im tired."-------------------------
#104248 07/20/2001 1:28 AM
Joined: Aug 2000
Posts: 299
Member
Member
Offline
Joined: Aug 2000
Posts: 299
Thanks!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)