Jump to:
| Project: | Database Scripts |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
I am experiencing some issues when trying to dump and restore on systems other than those I normally use. The normal setup, where I develop on OS X and where my production servers are FreeBSD is working as smooth as Drupal staging can be. Recently I was deploying on a Linux distro and I was encountering some strange problems. I have cooked it down to relate to the PHP file() function with FILE_IGNORE_NEW_LINES in dbscripts_process_tables(). The problems is that the line endings are not ignored, and therefore no table names are read. Dump and restore are unable to find any tables to do operations on.
I understand this is not all DBscripts related but I was wondering if anybody have experienced these issues. There is a lot of topics about file() and FILE_IGNORE_NEW_LINES with the latest versions of PHP, but I can't find any consistency in the errors related to my problems.
Thanks.
Comments
#1
I believe I'm running into the same problem and it is a show stopper for me.
I can succesfully dump, restore and merge when using two local OS X servers but can't get any of the scripts to work when using a local OS X dev server and a shared host for production running Linux.
The sort of errors a dump for example will show are hundreds of "sh: line 3: .sql: command not found" output.
-----
Update:
ACTUALLY - it appears the linux server's shell was pointing php -> php4 so I will have to retest. Probably not your problem after all.
-----
Update 2:
I am somewhat successfully developing on OS X and deploying on linux via svn. Any remaining problems I am having aren't related to this. Sorry.
#2
I am using the 1and1 hosting server and I had the same exact issue. In my case, 1and1 came stock with PHP4, so when I used PHP5 I was able to get it all to work. For example, this code did not work "./dbscripts/merge.php" but "php5 dbscripts/merge.php" did work.
Another idea is to rtrim() all the results from the php file() command. That is a big pain in the butt but will solve your problem if you do not have php5 installed.
#3
Anyone have an idea/desire for a solution to this?
Add a warning to the README?
Do the rtrim (slow processing?)?
#4
http://drupalcode.org/viewvc/drupal/contributions/modules/dbscripts/READ...
Added php5 required to the README.txt; will accept patches to further fix this if anyone wants, open if so.
#5
I have encountered the same issue with Dreamhost hosting. I have considered the rtrim option, however there is a slight problem I have encountered with the array created by the file not being persistent. Hence you can not reprocess array with the rtrim to get the correct array without the line feeds. This means that unless other solution is available the fix will have to be very tedious, as you have to fix not two instances of the file funciton but every use of the array, created, which runs close to 50-60 instances.
I am currently trying to make it work by running with php5 from command line. However as my linux/php skills are tha of a novice I would like if someone can confirm that if I run a dump.php or merge.php scripts with php5 that php5 will be used for all the child php scripts that dump.php and merge.php may call in the process.
Would really appreciate your help as I am currently at a standstill ... for some reason just prefexing the scripts with correct php5 call doesn't result in the correct result of the merge.php run.
Thank you,
Dima
#6
Just wanted to give a quick update. It looks like the merge errors were related to the issue with the old code. After updating to the Dec 22 build Merge goes further, however the merge conflict resolution doesn't seam to result in the clean database receiving the following results:
Merge start =========================
[outlaws]$ /usr/local/php5/bin/php ./dbscripts/merge.php
Raising increments of the 'development' branch ................................
Merging content ................................
DON'T PANIC! But, I'm afraid I have to inform you that the following tables
failed to merge:
Array
(
[0] => menu_links
[1] => users
)
Please correct the conflicts in './test.crystalrevolution.com/sites/all/backup/db/tmp/merge/data' (look for '<<<<<<<').
Afterwards, run './dbscripts/merge.php continue' to finish the merge.
Continue after conflicts are resolved in the tmp/merge/data ==========================================
[outlaws]$ /usr/local/php5/bin/php ./dbscripts/merge.php continue
Merge was successfull.
unable to load as conflicts are reported on a few tables==============================
[outlaws]$ /usr/local/php5/bin/php ./dbscripts/restore.php production
ERROR 1062 (23000) at line 418: Duplicate entry '580' for key 1
ERROR 1062 (23000) at line 47: Duplicate entry '24' for key 1
ERROR 1062 (23000) at line 47: Duplicate entry '24' for key 1
Restored the database preserving the full option of tables
End ==================================================================================
I was able to trace the first discrepancy to the table but still in the process of working out the rest.
Thanks,
Dima