var sidebar_align = 'right';
var content_container_margin = parseInt('350px');
var sidebar_width = parseInt('330px');
Moving a Database.
What's the best way to move a large site? Database and files totally about 1.5 gbs.
I did a back up and keep trying to restore. After hours it times out.
Shell, if you have it (for the db). If both are the same mysql version, use this:
mysqldump --opt -u user_username -p***** user_dbname > backup.sql
Tar and gzip the result:
tar -cvzf backup.tar.gz ./backup.sql
Move it to the new box, then unpack:
tar -zxvf ./backup.tar.gz
Then restore the sql:
mysql -u user_username -p*** user_dbname < backup.sql
I'd put this in another forum.
bear is definitely correct.
Show your reciprocal links on your website.
Why do you need to tar it? Why not just gzip it, and leave tar out of it?
Originally Posted by
what i usually do
mysqldump -u username -p databasename > dbname.sql
bzip2 -9 dbname.sql
mv dbname.sql.bz2 ~/www/
ssh over to new server...
bzip2 -d dbname.sql.bz2
mysql -u username -p dbname < dbname.sql
and it's set.
Force of habit.
Why do you need to tar it?
oh, and moved to technical forum...
You can actually also just rsync the entire directory over from /var/lib/mysql/db to the new server *if* there are no writes happening to the DB. If there are any writes going on then it may become corrupt.
John W, CISSP, C|EH
MS Information Security and Assurance
- Server Administration and Security
- Managed VPS and Dedicated Servers with VIP Service