Hello all,
I am trying to transfer a drupal site to a different hosting space.
The owner of the site is very sick, and has asked me to move the site into my hosting space.
I created a backup of all the files and database, and uploaded it to a test page, and ran into issues with memcache.

Apparently he was using memcache, which is not installed on my shared hosting account.
So my question is: Can i disable memcache, or run drupal without it?

The error that shows up is: Fatal error: Class 'Memcache' not found in /home/[redacted]/public_html/[redacted]/sites/all/modules/memcache/dmemcache.inc on line 162

Any help will be greatly appreciated.
Thank you :)

Comments

Guru’s picture

Yes, I believe you can disable memcache, as long as there's no other memcache dependent module or code in your site.

Memcache is used for enhancing a site's performance through, what else but, caching.

cog.rusty’s picture

Check sites/default/settings.php.

Look near the end for any $conf array elements which look like $conf['cache_inc'] = './sites/some/memcache/path'; or 'cache_inc' => './sites/some/memcache/path' and remove it.

Usually there is nothing else to disable.
Also, you can disable the memcache module in admin/build/modules which is just for stats.

If you still have a problem, check the installation instructions in http://drupal.org/project/memcache and go backwards from there.

--------- Edit:

Oops, you said Drupal 5. There are also some patches that you could try to undo -- I am not sure if that is absolutely necessary.

gumanov’s picture

Thanks for the replies.

Ok I have removed the line about memcache but I am now getting a different error..
Fatal error: Call to undefined function dmemcache_get() in /home/XXXXX/public_html/XXXXXXXX/includes/path.inc on line 86

And yes there was a patch applied I believe, since it is located in the site directory. filename: DRUPAL-5-7-cache-serialize.patch
I do not know how to undo it, since the owner was the one who applied it.
Any ideas?

cog.rusty’s picture

Except examining the patches, finding the files mentioned in them, adding back the lines which have a "-", and removing the lines which have a "+"....

Maybe a more realistic idea is to upload the latest Drupal 5.x package overwriting everything, and then run update.php.

Because I see a folder with patches for a few modules (such as cck), you could update those modules too.

gumanov’s picture

I would upload the latest drupal package, but I am unsure as to whether or not he modified any core files manually.

Also, would it be possible to invert the "+"s and "-"s in the patch file, and apply that?
Thing is I do not know how to apply a .patch file..

Oh and one more thing, would that be considered a safe update method - just overwriting all the files with the drupal 5.22 files, then running update.php?

cog.rusty’s picture

If he has hacked core files and hasn't kept notes, and he wants to keep the hacks, then it is going to be a dead-end installation with no future. Anyway, if you have a database backup and a full files backup, you don't have much to worry about.

Hmm... inverting the +s and -s, I hadn't thought of that. It should work, at least if you have all the patches he used, and the correct order. Details in http://drupal.org/patch/apply.

Overwriting the files should be OK for minor version upgrades, because no files are added or removed. (And you have the backup in any case). The alternative is to delete them keeping only the "sites" directory and then do a clean upload of everything. Then you run update.php to apply the database changes.

But keep an eye open for the "files" directory (in case it is not under "sites"), the theme(s) used which may be customized (in case they are direct edits on existing themes) and possibly .htaccess, and settings.php in case it has other modifications except memcache's.

Some of the modules may be also patched. (I can see a few module patches included in memchache for D5).

==== Edit:
By the way, now that I think of it, the patches did not introduce anything specific to memcache. I wonder if the error message comes from the memcache reporting module which may be still enabled in admin/build/modules.

gumanov’s picture

Good news :) :)

All warnings and errors are gone! :D
Here's what I did (for anyone interested in the future):

1) As suggested by cog.rusty - Remove the "$conf['cache_inc']" line from settings.php
2) Since the next error was from file: /includes/path.inc - Just replace this file with the original from drupal-5.7.tar.gz because I am using v5.7

A big Thanks to cog.rusty!