Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-17-2003, 07:22 PM   #1
Stud Money
So Fucking Banned
 
Join Date: Sep 2003
Location: Somewhere between my monitor and my chair
Posts: 3,214
Moving MySQL ?

Got a problem that i am hoping someone may have the answer too.

We want to move one of our MySQL databases from server a to server b.

What is the easiest way of doing this?

We have already tried to view a data dump but there is so much info in this single DB that it keeps crashing IE.

Any easy way around this short of asking our host to do it?
Stud Money is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:25 PM   #2
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Step One - Backup current database:

Telnet/SSH into your system (we'll call it machine1)
from the root directory, type
mysqldump --opt -uUSERNAME -p 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/SSH into machine1, and from the command prompt type the following:
cd /path/to/yourbackupdirectory
Then type
ftp MACHINE2
Replace MACHINE2 with the host name (eg. www.example.com ) or IP address (eg. 192.168.0.0 ) of your new server. This should open a connection and ask for your username/password, then it should say ftp>
Type the following, hitting enter after each line:
bin
cd /path/to/newdirectory
put dump.sql
It should take between 20 seconds and a few minutes depending on the size of the file. Now type:
close
quit
verify dump.sql is in the /path/to/new area on the new server.

Step Three - Restore to new server

Telnet/SSH into machine2
create a database on the mysql if necessary (ask your server admin for help with this as it varies from machine to machine)
at the prompt type
mysql -uUSERNAME -p 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
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:26 PM   #3
Stud Money
So Fucking Banned
 
Join Date: Sep 2003
Location: Somewhere between my monitor and my chair
Posts: 3,214
Thank you going to try this now

A quick question though if i may, will this be the same even if machine2 is hosted at a different company to machine 1?
Stud Money is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:27 PM   #4
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Yep
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:27 PM   #5
Stud Money
So Fucking Banned
 
Join Date: Sep 2003
Location: Somewhere between my monitor and my chair
Posts: 3,214
Thanks will lyk how it goes and if it worked
Stud Money is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:30 PM   #6
JSA Matt
So Fucking Banned
 
Join Date: Aug 2003
Location: San Diego, CA
Posts: 5,464
Can't you just move the MYD files?
JSA Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 07:31 PM   #7
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally posted by JSA Matt
Can't you just move the MYD files?
Not everyone is rute
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2003, 08:16 PM   #8
NetRodent
Confirmed User
 
Join Date: Jan 2002
Location: In the walls of your house.
Posts: 3,985
Quote:
Originally posted by JSA Matt
Can't you just move the MYD files?
Not if the servers aren't running the same version of mysql.
__________________
"Every normal man must be tempted, at times, to spit on his hands, hoist the black flag, and begin slitting throats."
--H.L. Mencken
NetRodent is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2003, 06:31 AM   #9
PbG
Confirmed User
 
Join Date: May 2003
Posts: 1,025
If you have Cpanel you can simply download a backup of the database and restore it on the new box.

Additionally you could SCP the file using the method described above.
PbG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2003, 07:46 AM   #10
Project-Shadow
Confirmed User
 
Industry Role:
Join Date: Feb 2003
Posts: 7,340
Quote:
Originally posted by PbG
If you have Cpanel you can simply download a backup of the database and restore it on the new box.

Additionally you could SCP the file using the method described above.
phpMyAdmin - Export DB

Then import it on your new box? 0.o
Project-Shadow is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2003, 08:07 AM   #11
sweet7
Confirmed User
 
Join Date: May 2003
Posts: 1,792
Quote:
Originally posted by Stud Money
Got a problem that i am hoping someone may have the answer too.

We want to move one of our MySQL databases from server a to server b.

What is the easiest way of doing this?

We have already tried to view a data dump but there is so much info in this single DB that it keeps crashing IE.

Any easy way around this short of asking our host to do it?
That's definately in their job description. Otherwise telnet/ssh into them and do what others are telling you.
__________________
ICQ: 282814268
sweet7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2003, 09:33 AM   #12
foe
Confirmed User
 
Join Date: May 2002
Location: CT
Posts: 5,246
Quote:
Originally posted by - Jesus Christ -
Step One - Backup current database:

Telnet/SSH into your system (we'll call it machine1)
from the root directory, type
mysqldump --opt -uUSERNAME -p 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/SSH into machine1, and from the command prompt type the following:
cd /path/to/yourbackupdirectory
Then type
ftp MACHINE2
Replace MACHINE2 with the host name (eg. www.example.com ) or IP address (eg. 192.168.0.0 ) of your new server. This should open a connection and ask for your username/password, then it should say ftp>
Type the following, hitting enter after each line:
bin
cd /path/to/newdirectory
put dump.sql
It should take between 20 seconds and a few minutes depending on the size of the file. Now type:
close
quit
verify dump.sql is in the /path/to/new area on the new server.

Step Three - Restore to new server

Telnet/SSH into machine2
create a database on the mysql if necessary (ask your server admin for help with this as it varies from machine to machine)
at the prompt type
mysql -uUSERNAME -p 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
This is definetly the best way to do it.

Dont use phpMyadmin, I found that for very big files it messes up sometimes.
foe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.