ober Posted November 6, 2006 Share Posted November 6, 2006 I'm moving a vbulletin board from one server to another and then converting it to SMF. I got the export on the old server to finally work and I've tried to import it on the new server, but it keeps bombing out. Apparently vbulletin stores it's attachments in the database, instead of in a folder elsewhere. And as soon as the database gets to the point of importing the attachments, it errors out.And as I'm sitting here writing this, I'm wondering if it's my export type. Currently, it's all exported to a text/SQL format. Do I need to be exporting it as something else since it's obviously storing binary images in there? Quote Link to comment https://forums.phpfreaks.com/topic/26348-exportimport-with-attachments-in-db/ Share on other sites More sharing options...
fenway Posted November 6, 2006 Share Posted November 6, 2006 I remember something about --hex-blob being one of the export options somewhere... never used it though, since I've never had to. Quote Link to comment https://forums.phpfreaks.com/topic/26348-exportimport-with-attachments-in-db/#findComment-120473 Share on other sites More sharing options...
ober Posted November 6, 2006 Author Share Posted November 6, 2006 what do you use to import though? Because the only thing you can choose is "sql" in phpmyadmin. Quote Link to comment https://forums.phpfreaks.com/topic/26348-exportimport-with-attachments-in-db/#findComment-120474 Share on other sites More sharing options...
shoz Posted November 7, 2006 Share Posted November 7, 2006 If you have shell access or can access "mysqldump" and "mysql" with php's executions functions then you should be able to dump and restore the database using those apps. [code]<?php$dump = "mysqldump --host='...' --user='user' --password='pass' databasename --opt > /path/to/file.sql";$import = "mysql --host='..' --user='..' --password='..' dbname < /path/to/file.sql";?>[/code]Although you may be able to dump and import from the current host I'd upload the sql file and import from the new host.You can gzip the sql file to make it smaller if the dabatase is large.[code]mysqldump .... --opt | gzip -c > /path/to/file.sql.gz[/code]and then on the new host[code]gzip -d /path/to/file.sql.gzmysql .... dbname < /path/to/file.sql[/code]You may be able to use PhpMyadmin's sql file to do the import in which case you can skip the dumping using mysqldump.If this is a shared host other users may be able to see the username and password that you enter on the command line above so you may want to give a temporary user full access to the database.If you have shell access you should be able to put the username and pass in a ".my.cnf" file in your home dir to avoid that.[code][client]user=...password=...[/code] Quote Link to comment https://forums.phpfreaks.com/topic/26348-exportimport-with-attachments-in-db/#findComment-120833 Share on other sites More sharing options...
fenway Posted November 7, 2006 Share Posted November 7, 2006 Alternatively, just leave out the password, use -p, and you'll get prompted for it. Quote Link to comment https://forums.phpfreaks.com/topic/26348-exportimport-with-attachments-in-db/#findComment-120900 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.