GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How do you move MySQL database to different server? (https://gfy.com/showthread.php?t=573281)

Mr Pheer 02-07-2006 02:56 PM

How do you move MySQL database to different server?
 
I'm moving my biker forum to a new server, and dont know how to backup the current database, move it, and set it up on the new machine so i dont lose any of the users or posts on the board.

Can anyone give me a quick step by step to do this?

psili 02-07-2006 02:59 PM

server1>mysqldump --user=root --pass=pass --opt database > db.backup.sql
server1>sftp db.backup.sql server2.com

create the empty database on server 2

server2>mysql -u root -ppass database < db.backup.sql


i'm sure there's easier ways, but that's one of them in a nutshell

Mr Pheer 02-07-2006 03:02 PM

thanks man!

Mr Pheer 02-07-2006 04:52 PM

ok the importing does not work

anyone else know how to import the database on FreeBSD?

Brujah 02-07-2006 04:56 PM

That should be pretty flawless. Do you get an error ? Does it just not create the tables ? Is the mysql version different ? You may need a compatibility switch.

Mr Pheer 02-07-2006 05:04 PM

actually this works:
mysql -u admin -ppassword -D dbase < db.dbase.sql

X37375787 02-07-2006 05:30 PM

check the vBulletin documentation, it's described in detail how to move it.

P.S. I suggest you redirect the old server's traffic to the new IP immediately, before the DNS resolves to the new server.

uno 02-07-2006 05:34 PM

Use phpMyAdmin to dump the db to an sql file, then import it on the new server.

http://sourceforge.net/projects/phpmyadmin/

Easy as pie.

xroach 02-07-2006 05:34 PM

(approx)

cd /var/db/mysql/$dbname
tar cf $dbname.tar $dbname
scp $dbname.tar root@$targethost:/$targdir
ssh -l root $targethost
cd /var/db/mysql
tar xzvf <targdir>/<dbname>.tar
chown -R mysql:mysql <dbname>

uno 02-07-2006 05:35 PM

If you need help drop me an icq.


All times are GMT -7. The time now is 06:21 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123