I'm re-creating a drupal 5 site in drupal 7 (don't tell me to upgrade instead, please, long long story). On both the old and the new sites, there are a great number of attached files handled privately.

Putting the files into the appropriate directory on the new site doesn't cut it, because the db doesn't know about those files. Is there some brilliant way other than one at a time to clue in the db?

All help appreciated,

- catya

Comments

john_b’s picture

Depending on how many there and how quick are at learning this it may be quicker to re-upload files by hand, as they should also be processed into small, medium and large copies in D7 to work.

If you must migrate them in the db you will have to SELECT the file paths from the old db and INSERT them into the new. And the same for data from the file field. I don't have the exact the command, you need to look at the database in phpmyadmin or other database UI tool and work out the tables the paths are in on the old db, and which tables they should be in in the new db, then use the SQL tab to extract them from one and insert them into the other. There is a good tutorial on writing mysql queries at http://sqlzoo.net/

Maybe someone else will reply who knows the query you need immediately, I would have to work it out from scratch, and I do not even have D5 database to look at. Frankly if there are a lot, I would put it out on paid services section of the forums asking someone who is quick at this stuff to do it for you.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors