Export database then import with a new name

Export database then import with a new name

by Deleted user -
Number of replies: 2

I need to export my Moodle database from 1.6.4 (using phpMyAdmin), and then import it into a different server (also running 1.6.4). The problem is that it tries to CREATE the database with the same name (and gives me a #1044-ACCESS DENIED erroe), but I need it to have a different name, since the other server is a different host, and has a different naming comnvention.

How do I export all my tables, and then import the tables back into another database with a different name?

Thanks

Average of ratings: -
In reply to Deleted user

Re: Export database then import with a new name

by Andy Tagliani -
Jeff,

did you have acces to the old installation and or can you access to the course backup files. If your answer yes, why dont you nake not a new and clean installation and restore the course backup files?

I´m not a MySQL specialist, so i cannot give any information to that error warning.

Andy
In reply to Andy Tagliani

Re: Export database then import with a new name

by Deleted user -

Solved the problem... when you use phpMyAdmin to EXPORT a database, if you choose EXPORT from the Main Screen, it will ask you which database you want to export (it will export ALL tables), and it will then add the CREATE command to the file, so that when you IMPORT it elsewhere, it will try to CREATE the same database with the same name.

The way to bypass this CREATE database, is to hit EXPORT from just about any other page except the main page of phpMyAdmin. In this case, you should get a list of all the tables in the database, and be able select which tables you want to export (any or all of them). When you go to IMPORT your file, it will NOT try to create the database, it will just import the tables into whatever database you want, even if it has a different name!

See this discussion on the phpMyAdmin forum:

http://sourceforge.net/forum/forum.php?thread_id=1810979&forum_id=72909