A fix for the temp-folder mismatch when migrating between systems (patch)
| Project: | Backup and Migrate |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
I'm often migrating my Drupal db between a local version and a live/dev-version on another server. Sometimes the migration goes from Windows to Linux or vica versa.
Thanks to this fantastic module, it works generally without problems. However, everytime I migrate to another system, the temp-folder settings gets overwritten (as long as the variables-table is migrated), resulting in annoying temp-folder errors. With Windows to Linux this happens all the time (going from f.e. "C:\www\tmp" to "\tmp").
The temp-folder can be fixed manually very easily by visiting "admin/settings/file-system" ... and this is what I've done for a few years now. Today I realized that this annoyance is rather easily fixable. So I did one (against the latest dev-version).
All it does is add a simple checkbox on the restore page at "admin/content/backup_migrate/restore". When it is checked, the old temp-folder value gets restored right after the migration is done. Only a few lines of code, but it works well. The patch might need some cleaning up. For example I used "$_POST['restore_tmp_folder']" directly to check if the checkbox was checked, which maybe too dirty (even though it doesn't create any security risk or such).
I believe I can't be the only one annoyed by this small but unnecessary task. I couldn't find another issue about this, so I posted my own. Still, I'm sure lots of people have found this annoying (but were maybe too lazy to complain?).
(Another small migration annoyance, actually totally unrelated and happens in Drupal 5 only: after each migration I had to visit admin/build/menu to update the menu link structure of admin_menu, if the base_path was different between the versions. In Drupal 6 this seems to be automatically fixed. Don't know if the fix was in core menu, admin_menu or backup_migrate.. thought I'd just mention that too.
| Attachment | Size |
|---|---|
| backup_migrate-dev-27.9_temp_folder.patch | 1.79 KB |

#1
Thanks for the patch hopefully it helps some people. This might be a little be too specific for inclusion in the module itself, but maybe if I get time I'll work this into a more general variable modifying filter.
How I usually solve an issue like this is to override the variables in my local settings.php in the conf array. This is a nice way to set variables per environment in a way that won't get overwritten when the database is restored from live.
#2
Thanks for the tip. Didn't think about the conf-array. I thought those settings would be overwritten too.
Going to use conf array for now. I also hope you find the time to do that general variable mod filter sooner or later :).