Log in

View Full Version : how to transfer big database from webhost to dedicated server..


sameerzx
11-02-2006, 12:22 PM
my site is www.desibbrg.com i am hosting my site in godady .know i have bought a dedicated server which will be ready in 2 more days...
i am worried about how would i transfer the mysql database to the new server..as godady wont provide us ssh so its difficult for me ...if any one have any good suggestion please help....

thanks in advance:) :)

Paul M
11-02-2006, 06:05 PM
Save it to local disk via phpmyadmin - or use the vb backup system (or one of the mods here) to save it to a file on the server and then ftp the file. Import it via ssh/mysql commands on your dedicated server.

Stormwolf
11-02-2006, 06:11 PM
In one of my moves I was given this code by the host and have been using it pretty much ever since. Not sure how big you are, but give it a shot.

Download your current database as a .sql file and then upload it to the new host.

Make your new database/user/password at your new host.

Copy and paste this code into notepad or something and save it as import.php or whatever you want. Edit it as needed with your username/pass and file paths.Upload that to the server and run it www.yoursite.com/import.php It will take a while, but it should import the .sql into your database.

<?PHP
$TheFile = "/home/user/public_html/foldername/filename.sql";
$User = "mysqluser"; // NOTE: Either use a MySQL user or your CPanel/Netadmin user
$Password = "mysqlpass";
$DatabaseName = "mysqldatabase"; // NOTE: The database is prefixed with your CPanel/Netadmin user

$Results = shell_exec( "mysql -u$User -p$Password -hlocalhost $DatabaseName < $TheFile" );

echo "Results from MySQL import of $DatabaseName with User $User with file $TheFile:\r\n $Results\r\n";
?>

Zachery
11-02-2006, 09:58 PM
If hes got a dedicated server, he doesnt need to run a php script to run a shell command ;)

sameerzx
11-03-2006, 11:04 AM
thank u for help brothers ...really appreciated ur replies .

i forgot to mension .. the sql and php versions r diffrents.
and my dedicated server is not on godaddy ..it's on another hosting website .

on godaddy sql and php version is :

MySQL Version: 4.0.27
PHP Version: 4.3.11

on new dedicated server is :

php 4.4.4
sql 4.1.21 standard

i hope my data will be comtable on higher php and sql versions.

iam provided u this info ..just to make sure evry thing will go fine with transfering my site ....and u guys r the best to get advice from.

my Q is : do i still need to go with ur suggestions after i provide u this diffrence in php and sql versions..?

thank u in advance agine and agine.... and sorry for my bad english.

regards

Paul M
11-03-2006, 12:56 PM
Data exported from mysql 4.0.27 will import into 4.1.21 fine. The php versions won't have any effect on this.