1 (edited by nsgiaotienweb 2011-06-11 11:50)

Topic: How to backup a database to import to another database on another host

Hello,
This is my very very big problem. It may cause me to leave my punBB forum and choose to set up a non-MySQL forum. It's disastrous because I like my punBB forum.

For example:
My 1st host:
- Domain: abc.com
- Has a punBB forum
- A MySQL database name: a1111_punbb
- The database's user and password are: a1111 and 123456
- MySQL host name is xxx.abc.com

Now my host is crashed and I must move the forum and its database to another host (2nd host). Also I change my domain.
- Domain: def.com
- MySQL database name: b3333_forum
- The database's user and password are: b3333 and 123456
- MySQL host name is xxx.def.com


Please help me answer these questions:
1/ What do I need to do to back up my MySQL database "a1111_punbb" at "abc.com" (1st host)?
2/ Then how to import that back-up file to my new database "b3333_forum" at "def.com".

3/ I think I must change something in the back-up file, also. Because my new database will have a new name; it'll be on a new host and a new domain,...


I've tried to export my "a1111_punbb". It creates a .sql file. Then I've tried to import it to my "b3333_forum" but it keeps displaying errors about missing parameters, invalid,... or something like that.

It makes me go crazy! Now I'm very afraid that one day, if my host crashes and I need to move to another host, I can't bring my MySQL database with me and all posts, replies in my forum will be lost.

Thank you very much.

Re: How to backup a database to import to another database on another host

If you use any hosting software like CPanel - make all backup and restore operation from it.
If you have PHPmyAdmin - use it.

In last order if you have only ssh access to hosting — use this command

mysql -u USERNAME -p PASSWORD < DATABASE_FILE.sql

 
but it may depends on some paramaters...

3 (edited by nsgiaotienweb 2011-06-12 11:55)

Re: How to backup a database to import to another database on another host

dimkalinux wrote:

If you use any hosting software like CPanel - make all backup and restore operation from it.
If you have PHPmyAdmin - use it.

In last order if you have only ssh access to hosting — use this command

mysql -u USERNAME -p PASSWORD < DATABASE_FILE.sql

 
but it may depends on some paramaters...

Thank you.
Could you make an example about which parameters we should set when exporting a MySQL database by using phpAdmin? I just use the default setting, and when I import the .sql file to another database, it displays an error about "missing import type" (I can't see anything "Import type" to select when using Import function in phpAdmin)???

Re: How to backup a database to import to another database on another host

Could you post the exact text/a screencap of the error you're getting?

Re: How to backup a database to import to another database on another host

hklown wrote:

Could you post the exact text/a screencap of the error you're getting?

Hi. It is "Missing import parameters". That's all :-(

According to your experiences, do you need to edit .sql file? (because in that file there are many lines with old domain. So I need to edit to new domain)?

Re: How to backup a database to import to another database on another host

i use PhpMyAdmin to create a Backup. and when you install PunBB... you need to change information of DB into config.php smile

Re: How to backup a database to import to another database on another host

PHPMyAdmin is great for importing/exporting databases. Combine that with notepad's replace function and you can sort things out very quickly. Use notepad to update your database with new info like base url and things like that.

Re: How to backup a database to import to another database on another host

For download NotePad++ : http://notepad-plus-plus.org/download/v5.9.6.2.html