0

Moving drupal 7.12 site from dev to staging, images stored in data are missing.

  • dev is OSX 10.7 with mysql 5.5.9
  • staging is Ubuntu 10.04 with mysql 5.1.61

On dev, the images are uploaded to a cck field to a node entity.

To move to staging, we

  1. on dev, flush caches and bounce the amp stack.
  2. then make a mysqldump which copied to staging.
  3. on staging, the target database is droped and recreated
  4. then the target database is loaded':' mysql -u user -p targetdatabase < backupfromdev.sql

I seems that the missing images are the most recently added, so perhaps they are stilled cached, but how? What do we need to do to insure that the mysqldump is current and complete?

1

You need to copy over your sites/default/files directory.

|improve this answer|||||
  • I was thinking that the images were stored as binary in mysql. Still then I have the question, because before the moving the database, as described above, we tar.gz the complete project from drupal root on dev. On staging, we rename the target directory, and then unzip the site to a clean directory, (and then modify settings.php and robots.txt for environment). So there should be no issue with files. – August1914 Mar 28 '12 at 20:49
  • 1
    Make sure the path to the public file system points to the correct location then, and that the files are there. You can find that in Configuration > Media > File system. – Berdir Mar 28 '12 at 21:11
  • Also make sure your webserver has read/write permission for that path. For example: chown -R apache: sites/default/files – JamesK Mar 28 '12 at 21:13
  • Thanks JamesK, that part is all fine. Turned on nids in an view of images, and narrowed it down to a particular node with a missing image, and then determined that it was not present on staging, but was on dev. So I went back and unzipped the site on dev and verified that the missing images were not in the site.tar.gz. Clearly they were on disk, as they displayed on the dev site. So I guess the question is, what should we do to make sure that both the mysql database and the file system is good to go? – August1914 Mar 28 '12 at 21:24
  • Just to confirm, the problem was that .jpg files on the dev site, which were displaying in on the dev site, where not included in the site.tar.gz. Maybe they were in a disk cache, maybe tar skipped because of a lock? Either way, would like to eliminate this as a variable in deployments. – August1914 Mar 28 '12 at 22:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.