PDA

View Full Version : moving database to another server


FockerFGAA
03-06-2007, 02:54 PM
is there an easier way to accomplish moving a database then by going into myadmin and exporting the database and then importing it to the new server? the problem is our old server basically times out everytime i try to export the database. any help would be appreciated.

Ntfu2
03-06-2007, 03:22 PM
You should move the database via SSH

mysqldump -u DATABASE_USERNAME -p DATABSE_NAME > DATABASE_NAME.SQL

It'll prompt you for password.

then scp DATABASE_NAME.SQL username@new_server_ip_address:/

then it'll ask for your new server password.

That will move the database directly from old server to new server and place it in the / directory

simply create the database on your new server, and restore it using this command

mysql -u DATABASE_USERNAME -p DATABASE_NAME < /DATABASE_NAME.SQL

new database moved, and restored.

FockerFGAA
03-06-2007, 03:40 PM
hmm. how do i know what my ssh access is? i tried using the ip of the server but it just says that the session was closed.

Ntfu2
03-07-2007, 06:05 PM
username should be whatever you login to cPanel with. If your on shared hosting you may have to ask your hosting company to enable SSH or do the export and transfer for you.

Marco van Herwaarden
03-15-2007, 09:07 AM
The only reliable method of backing up and restoring a database is with shell access via telnet or ssh. This is because backing up with a PHP script like that in the Admin CP or phpMyAdmin can result in PHP timeouts errors and an incomplete backup file. Please see the instructions here:


Backup:
http://www.vbulletin.com/docs/html/maintenance_ssh_backup


Restore:
http://www.vbulletin.com/docs/html/maintenance_ssh_restore


P.S. If you don't have shell access, some people have also reported success with these scripts:


MySQLDumper:
http://www.mysqldumper.de/en/index.php


MySQLHotxcopy:
http://www.vbulletin.com/forum/showthread.php?t=134821&highlight=mysqlhotcopy


Bigdump:
http://www.ozerov.de/bigdump.php

honestdave
03-16-2007, 01:20 AM
The only reliable method of backing up and restoring a database is with shell access via telnet or ssh. This is because backing up with a PHP script like that in the Admin CP or phpMyAdmin can result in PHP timeouts errors and an incomplete backup file. Please see the instructions here:

how does this compare to doing a cpanel backup?

are cpanel backups often incomplete?

Marco van Herwaarden
03-16-2007, 03:21 AM
cPanel does not perform the backup inside the browser, but submits a job to the server cron to run mysqlbackup. They should be fine.