tranfering databases from phpMyAdmin between servers

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

tranfering databases from phpMyAdmin between servers

Post by m3mn0n »

I have just got a new webhost and i do not want to loose all my contents of my forum database and translation database.

I did a google search for tranfering databases in phpMyAdmin and this is all i got:
Transfering databases via
browser might not be the best idea, anyway.


On origin server:
mysqldump dbname > dbname.sql


On target server:
ftp dbname.sql to a local directory on the target;
mysqladmin create dbname
cat dbname.sql | mysql dbname
Can anyone elaborate on this? Some newbie friendly instructions would be much apriciated.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

I think you just need to back up the database. Which is what the tutorial suggested. Creating back up SQL query.

Good tutorial here:-

http://www.mysql.com/doc/en/Backup.html
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

thx alot, i'm too tired to do it now, but when i get to it, i hope it works!

*adds into favorites*

8)
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

hi,

If u have ssh, telnet access to u r server, then u can try this:

Go into the directory where u store u r database files.
This location can be found from the mysql startup script, on red hat linux 6.x/7.x it is "/etc/rc.d/init.d/mysql".
See the value of variable named "datadir" -OR- search for string like "--datadir=$datadir".

From this above found directory do:
tar czvf urdb.tgz *
This should create the file "urdb.tgz"

Then ftp/sftp/scp u r tgz file into u r new server.

Find the new server's mysql's database storage location, as above.

And then extract the copyed file:
tar xzvf urdb.tgz
Will create all the data structure on new server !
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Grrhhh, I can't try your way cos I haven't got Linux!!!! :evil:
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

In phpMyAdmin just log into your database and go to your database's front page where it has the table list, on the database dump area select all tables choose data and structure and send as file (these vary between versions), then click OK and you should be prompted to download a file. Save this file then go to your new host and upload the file on the front page of your database where the table listings are, either that or open the file and copy and paste the data into the textarea.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Thought phpMyAdmin had an backup thing
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

It does, that's what I was referring to, the "database dump" dumps all the data from the database into a file that can then be uploaded to a different server or the same one in case of a server crash.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

That's what I mean to I missed out "," etc.
I though phpMyAdmin had an backup thing... Thanks for reminding me.
Post Reply