when I develop on my home box (ocdevel.local) & push to production (ocdevel.com), none of the file fields carry over. The actual files carry over (sites/default/files/*), but the field in node view or edit just act like I never uploaded a file.

Comments

jmlavarenne’s picture

You uploaded the database tables also right? Sorry if this is obvious.

lefnire’s picture

yes, and the {files} table has sites/ocdevel.local/files/images/x.jpg for the files instead of /sites/ocdevel.com/files/images/x.jpg

ps, in the first comment i said my files are at sites/default/files/, the are at sites/ocdevel.local/files/* which I change to sites/ocdevel.com/files/* on migrate, just realized that might make a big difference?

jmlavarenne’s picture

Yes it could. If you did not update the information in your database, I suppose Drupal will still be looking for the files at ocdevel.local.

lefnire’s picture

imagefield in d5 took care of this automatically, but i think that was because files were at /files, rather than /site/x/files. in fact, now that i think about it there's probly no easy way for the module itself to take care of this, is there? if not, feel free to close this issue. for those in the future that hit this problem, I guess mysql find/replace is the best way to go about it

dopry’s picture

Status: Active » Closed (fixed)

yeppers know issue with core file handling adding the file_directory_path to the filepath.. You can either create a symlink on your production environment or update the paths in the DB. I suggest you update the paths in the DB and use matching paths in both prod and dev for file directory path.